@using Microsoft.AspNetCore.Mvc.Localization
@inject IViewLocalizer Localizer
@using Microsoft.AspNetCore.Hosting
@using Microsoft.Extensions.Hosting
@model LiteCharmsSecurity.STS.Identity.ViewModels.Home.ErrorViewModel
@inject IWebHostEnvironment Host

@{
	var error = Model?.Error?.Error;
	var errorDescription = Host.IsDevelopment() ? Model?.Error?.ErrorDescription : null;
	var request_id = Model?.Error?.RequestId;
}

<div class="py-8">
	<h1 class="text-4xl font-bold mb-6">@Localizer["Title"]</h1>

	<div class="max-w-2xl">
		<div class="alert-destructive">
			<lucideicon name="alert-circle" class="h-4 w-4" />
			<div>
				<h5 class="alert-title">@Localizer["Message"]</h5>
				<div class="alert-description">
					@if (error != null)
					{
						<strong>
							<em>
								: @error
							</em>
						</strong>

						if (errorDescription != null)
						{
							<div class="mt-2">@errorDescription</div>
						}
					}
				</div>
			</div>
		</div>

		@if (request_id != null)
		{
			<div class="mt-4 text-sm text-muted-foreground">@Localizer["Request"] @request_id</div>
		}
	</div>
</div>
