@page "/Error"
@using System.Diagnostics
@rendermode @(new InteractiveServerRenderMode(prerender: false))

<div class="d-flex align-items-center justify-content-center">
    <div class="text-center">
        @if (Code == 404)
        {
            <PageTitle>Page Not Found</PageTitle>

            <h1 class="display-1 fw-bold">404</h1>
            <p class="fs-3"><span class="text-danger">Ops!</span> Page Not Found.</p>
            <p class="lead">
                The page you're looking for does not exists.
            </p>
        }
        else if (Code > 0)
        {
            <PageTitle>Unexpected Error</PageTitle>

            <h1 class="display-1 fw-bold">500</h1>
            <p class="fs-3"><span class="text-danger">Ops!</span> Unexpected error.</p>
            <p class="lead">
                An unexpected error occurred while loading the page. Please, wait a minute and try again.
            </p>
        }

        <a title="Back to Home" href="/" class="btn btn-primary"><i class="bi bi-house-door-fill"></i> Back to Home</a>
    </div>
</div>

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

    [Parameter]
    [SupplyParameterFromQuery(Name = "code")]
    public int Code { get; set; }
}
