VadVergasov_Programming/5/Lab_153503_Verhasau/Lab_153503_Verhasau/Views/Shared/_UserInfoPartial.cshtml
@using Lab_153503_Verhasau.ViewComponents;
@if (User.Identity.IsAuthenticated)
{
    @await Component.InvokeAsync(typeof(Cart))
    <div class="dropdown ms-4 nav-color">
        <button class="btn btn-secondary dropdown-toggle"
                type="button" id="dropdownMenuButton"
                data-bs-toggle="dropdown"
                aria-expanded="false">
            @User.Claims.FirstOrDefault(c => c.Type.Equals("Name", StringComparison.OrdinalIgnoreCase))?.Value
            <img src="https://localhost:7003/avatar" width="30"
                 alt="User" class="rounded nav-color" />
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
            <li>
                <span class="dropdown-item-text">
                    <img src="https://localhost:7003/avatar"
                         width="50" alt="User" class="rounded" />
                    @User.Claims.FirstOrDefault(c => c.Type.Equals("Name", StringComparison.OrdinalIgnoreCase))?.Value
                </span>
            </li>
            <li><hr class="dropdown-divider"></li>

            <li>
                <form id="logoutForm" class="form-inline" method="post">
                    <button id="logout" type="submit" class="nav-link
btn btn-link text-dark" asp-controller="Identity" asp-action="Logout">
                        Logout
                    </button>
                </form>
            </li>
        </ul>
    </div>
}
else
{
    <div class="ms-auto">
        <form id="loginForm" class="form-inline">
            <button id="login" type="submit" class="nav-link btn btn-link text-light" asp-controller="Identity" asp-action="Login">
                Login
            </button>
        </form>
    </div>

}
