@page "/"
@layout Layout.CmsHomeLayout

<PageTitle>Deep DRFT Management</PageTitle>

<HierarchicalRoleAuthorizeView>
    <Authorized>
        <RedirectToCatalogue />
    </Authorized>
    <NotAuthorized>
        <MudStack AlignItems="AlignItems.Center" Spacing="4" Class="my-8">
            <MudImage Fluid="true" Src="img/cms-hero.webp" Alt="Deep Drft" />
            <MudText Typo="Typo.subtitle1" Align="Align.Center" Class="text-uppercase mud-text-secondary">
                Catalogue Management
            </MudText>
            <MudButton Variant="Variant.Filled"
                       Color="Color.Primary"
                       Href="@LoginHref"
                       Class="mt-4"
                       Style="min-width: 200px;">
                Login
            </MudButton>
        </MudStack>
    </NotAuthorized>
</HierarchicalRoleAuthorizeView>

@code {
    private static readonly string LoginHref =
        $"/account/login?returnUrl={Uri.EscapeDataString("catalogue")}";
}
