Iceshrimp.NET/Iceshrimp.Backend/Components/RootComponent.razor

38 lines
No EOL
1.2 KiB
Text

@using System.Text.Encodings.Web
@using Iceshrimp.Backend.Core.Configuration
@using Iceshrimp.Backend.Core.Middleware
@using Microsoft.Extensions.Options
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@inject IOptions<Config.InstanceSection> Instance
@preservewhitespace true
@attribute [RazorSsr]
<!DOCTYPE html>
<html lang="en">
<!--suppress HtmlRequiredTitleElement, Justification: HeadOutlet -->
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="/Iceshrimp.Backend.styles.css"/>
<link rel="stylesheet" href="/css/default.css"/>
<link rel="icon" type="image/png" href="/favicon.png"/>
<HeadOutlet/>
<PageTitle>Iceshrimp.NET</PageTitle>
</head>
<body>
<Router AppAssembly="@typeof(RootComponent).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData"/>
</Found>
</Router>
<footer>
<strong>Iceshrimp.NET</strong> v@(Instance.Value.Version)
<span class="float-right">
<a href="/login?rd=@UrlEncoder.Default.Encode(Context.Request.Path)">Login</a>
</span>
</footer>
</body>
</html>
@code {
[CascadingParameter] public required HttpContext Context { get; set; }
}