@inherits LayoutComponentBase
@inject IConfiguration Configuration

<MudThemeProvider Theme="CustomThemes.Ceruleantheme" />
<MudPopoverProvider />
<MudDialogProvider />

<MudLayout>
    <MudAppBar Class="no-print">
        <MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
        TSA Chapter Organizer - @Configuration["ChapterSettings:Name"]
        <MudSpacer />
        <AuthorizeView>
            <MudText Typo="Typo.body2">Logged in</MudText>
            
            <form action="Auth/CookieLogout" method="post">
                <button type="submit" class="btn btn-primary">Logout</button>
            </form>
        </AuthorizeView>
    </MudAppBar>
    <MudDrawer @bind-Open="@_drawerOpen" Class="no-print">
        <NavMenu/>
    </MudDrawer>
    <MudMainContent>
        <MudContainer MaxWidth="MaxWidth.ExtraLarge">
        @Body
        </MudContainer>
    </MudMainContent>
</MudLayout>
@code {
    bool _drawerOpen = true;

    void DrawerToggle()
    {
        _drawerOpen = !_drawerOpen;
    }
}

<div id="blazor-error-ui">
    An unhandled error has occurred.
    <a href="" class="reload">Reload</a>
    <a class="dismiss">🗙</a>
</div>
