@inherits ComponentBase

<BaseContainer Title="@_title" Breadcrumbs="@_breadcrumbs">
    <Content>
            @if (Account is not null)
            {
                <MudGrid>
                    <MudItem xs="12" sm="6" md="6" lg="3">
                        <KeyValueCard T="string" Key="E-Mail" Value="@Account.Email" Icon="@Icons.Material.Outlined.Email" />
                    </MudItem>
                    <MudItem xs="12" sm="6" md="6" lg="3">
                        <KeyValueCard T="string" Key="Password" Value="@("******")" OnClick="()=>_passwordDialog?.Toggle()" Icon="@Icons.Material.Outlined.Password" />
                    </MudItem>
                    <MudItem xs="12" sm="6" md="6" lg="3">
                    <KeyValueCard T="string" Key="2FA" Value="@(Account.TwoFactorEnabled ? "Enabled" : "Disabled")" Icon="@Icons.Material.Outlined.SecurityUpdateGood" OnClick="()=>_twoFactorDialog?.Toggle()" />
                    </MudItem>
                </MudGrid>

                <CascadingValue Name="User" Value="@Account">
                    <ProfilePasswordDialog @ref="_passwordDialog" />
                    <ProfileTwoFactorDialog @ref="_twoFactorDialog" OnToggle="OnRefreshAsync" />
                </CascadingValue>
            }
    </Content>
</BaseContainer>

@code{
    private ProfilePasswordDialog? _passwordDialog;
    private ProfileTwoFactorDialog? _twoFactorDialog;
}