@using Moonlight.App.Services.Sessions
@using Moonlight.App.Database.Entities

@if (User != null)
{
    if (User.Admin)
    {
        @ChildContent
    }
    else if(!Silent)
    {
        <div class="alert alert-danger">
            <TL>Missing admin permissions. This attempt has been logged ;)</TL>
        </div>
    }
}

@code
{
    [Parameter]
    public RenderFragment ChildContent { get; set; }

    [CascadingParameter]
    public User? User { get; set; }

    [Parameter]
    public bool Silent { get; set; } = false;
}
