Iceshrimp.NET/Iceshrimp.Frontend/App.razor
2024-09-18 20:10:34 +02:00

26 lines
No EOL
1 KiB
Text

@using Iceshrimp.Frontend.Components
@using Microsoft.AspNetCore.Components.Authorization
<ErrorBoundary>
<ChildContent>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
<RedirectToLogin/>
</NotAuthorized>
</AuthorizeRouteView>
@* <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/> *@
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Page not found.</p>
</LayoutView>
</NotFound>
</Router>
</ChildContent>
<ErrorContent Context="Exception">
<ErrorUi Exception="Exception"></ErrorUi>
</ErrorContent>
</ErrorBoundary>