53 lines
1.3 KiB
Plaintext
53 lines
1.3 KiB
Plaintext
@using Microsoft.Extensions.Options
|
|
@using Moonlight.Frontend.Configuration
|
|
@using ShadcnBlazor.Extras.Alerts
|
|
@using ShadcnBlazor.Sidebars
|
|
|
|
@inherits LayoutComponentBase
|
|
|
|
@inject IOptions<LayoutPageOptions> LayoutPageOptions
|
|
|
|
<SidebarProvider DefaultOpen="true">
|
|
<AppSidebar/>
|
|
|
|
<SidebarInset>
|
|
<AppHeader/>
|
|
|
|
@foreach (var headerComponent in HeaderComponents)
|
|
{
|
|
<DynamicComponent Type="headerComponent" />
|
|
}
|
|
|
|
<div class="mx-8 my-8 max-w-full">
|
|
<AlertLauncher/>
|
|
|
|
@Body
|
|
</div>
|
|
|
|
@foreach (var footerComponent in FooterComponents)
|
|
{
|
|
<DynamicComponent Type="footerComponent" />
|
|
}
|
|
</SidebarInset>
|
|
</SidebarProvider>
|
|
|
|
@code
|
|
{
|
|
private Type[] HeaderComponents;
|
|
private Type[] FooterComponents;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
HeaderComponents = LayoutPageOptions.Value.Components
|
|
.Where(x => x.Slot == LayoutPageSlot.Header)
|
|
.OrderBy(x => x.Order)
|
|
.Select(x => x.ComponentType)
|
|
.ToArray();
|
|
|
|
FooterComponents = LayoutPageOptions.Value.Components
|
|
.Where(x => x.Slot == LayoutPageSlot.Footer)
|
|
.OrderBy(x => x.Order)
|
|
.Select(x => x.ComponentType)
|
|
.ToArray();
|
|
}
|
|
} |