@page "/not-found"
@inject ILocalizationService Loc
@rendermode InteractiveServer

<PageTitle>@Loc["page.title.not_found"]</PageTitle>

<h1>@Loc["notfound.heading"]</h1>
<p>@Loc["notfound.message"]</p>
<a href="/">@Loc["notfound.link.back_to_home"]</a>

@code {
    [CascadingParameter]
    private HttpContext? HttpContext { get; set; }

    protected override void OnInitialized()
    {
        if (HttpContext is not null)
        {
            HttpContext.Response.StatusCode = StatusCodes.Status404NotFound;
        }
    }
}
