@using System.Security.Claims
<AuthorizeView>
    <Authorized Context="authContext">
        <div class="d-flex justify-content-end align-items-center gap-3 px-3 py-2">
            <span class="text-dark">
                Bienvenido, @GetUserDisplayName(authContext.User)
            </span>
            <a href="Logout" class="btn btn-sm btn-danger rounded-3 d-flex align-items-center gap-1 text-decoration-none">
                <i class="oi oi-account-logout"></i>
                <span>Cerrar sesión</span>
            </a>
        </div>
    </Authorized>
</AuthorizeView>
@code {
    private string GetUserDisplayName(ClaimsPrincipal user)
    {
        return user.FindFirst("fullName")?.Value
            ?? user.Identity?.Name
            ?? "Usuario";
    }
}
