@page "/Account/Manage/PersonalData"

@inject IdentityUserAccessor UserAccessor
@inject IStringLocalizer<PersonalData> Localizer

<PageTitle>@Localizer["Title"]</PageTitle>

<StatusMessage />

<BoardComponent>
    <BoardCardComponent Heading="@Localizer["Title"]">
        <p>@Localizer["PersonalData_Description"]</p>
        <p><strong class="text-error font-bold">@Localizer["PersonalDataDelete_Warning"]</strong></p>
        <form action="Account/Manage/DownloadPersonalData" method="post" class="w-full my-3">
            <AntiforgeryToken />
            <button class="btn btn-primary w-full" type="submit">@Localizer["PersonalDataDownload_Submit"]</button>
        </form>
        <p>
            <a href="Account/Manage/DeletePersonalData" class="btn btn-error w-full">
                @Localizer["PersonalDataDelete_Submit"]
            </a>
        </p>
    </BoardCardComponent>
</BoardComponent>

@code {
    [CascadingParameter]
    private HttpContext HttpContext { get; set; } = default!;

    protected override async Task OnInitializedAsync() {
        _ = await UserAccessor.GetRequiredUserAsync(HttpContext);
    }
}
