@using MongoDB.Bson;

<MudDrawer @bind-Open="_visible" Anchor="Anchor.End" Elevation="0" Variant="@DrawerVariant.Temporary" ClipMode="DrawerClipMode.Always" Width="400px" Style="max-width:auto;">
    <MudDrawerHeader>
        <MudText Typo="Typo.h6">
            Delete Account
        </MudText>
    </MudDrawerHeader>
    <MudStack Class="px-6">
        @if (Account is not null)
        {
            <EditForm Model="@Account" OnValidSubmit="SubmitAsync">
                <MudStack Spacing="5">
                    <MudTextField T="string" @bind-Value="Account.Email" For="()=>Account.Email" Label="E-Mail" Variant="Variant.Text" Margin="Margin.Dense" ReadOnly />
                </MudStack>
                <MudStack Justify="Justify.Center" Row Class="mt-7">
                <MudButton OnClick="()=>_visible = false" Variant="Variant.Outlined" DisableElevation Size="Size.Large" Color="Color.Surface">
                    Cancel
                    </MudButton>
                    <MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" DisableElevation Size="Size.Large" Color="Color.Error" Style="width: 100%;">
                    Delete
                    </MudButton>
                    </MudStack>
                    </EditForm>
        }
    </MudStack>
</MudDrawer>

@code {
    private bool _visible;
    public void Toggle()
    {
        _visible = !_visible;
        StateHasChanged();
    }
}