@using System.Security.Claims

<ul class="navbar-nav">
    @if (User.Identity?.IsAuthenticated == true)
    {
        var fullName = User.FindFirstValue("FullName") ?? User.Identity.Name;
        <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle text-dark" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                <span class="user-welcome">Hola, @fullName</span>
            </a>
            <ul class="dropdown-menu dropdown-menu-end">
                <li><h6 class="dropdown-header">@User.Identity.Name</h6></li>
                <li><hr class="dropdown-divider"></li>
                <li>
                    <form asp-controller="Account" asp-action="Logout" method="post">
                        <button type="submit" class="dropdown-item">
                            <i class="bi bi-box-arrow-right me-2"></i>Cerrar Sesión
                        </button>
                    </form>
                </li>
            </ul>
        </li>
    }
    else
    {
        <li class="nav-item">
            <a class="nav-link text-dark" asp-controller="Account" asp-action="Register">Registrarse</a>
        </li>
        <li class="nav-item">
            <a class="nav-link text-dark" asp-controller="Account" asp-action="Login">Iniciar Sesión</a>
        </li>
    }
</ul>