@using Insight.Web.Models.Account;

<MudDrawer @bind-Open="_visible" Anchor="Anchor.End" Elevation="0" Variant="@DrawerVariant.Temporary" ClipMode="DrawerClipMode.Always" Width="400px" Style="max-width:auto;">
    <MudDrawerHeader Class="mt-3">
        @Model?.Name
    </MudDrawerHeader>
    <MudStack Justify="Justify.Center" Class="px-6">
        <MudContainer Style="max-height: 300px; overflow-y: scroll">
            <MudText Style="white-space: pre-wrap;">
                @Model?.Description
            </MudText>
            <MudItem Class="mt-7">
                <MudLink Href="@Model?.SupportUrl" Target="_blank" Typo="Typo.inherit" Underline="Underline.None">
                    @Model?.SupportUrl
                </MudLink>
            </MudItem>
        </MudContainer>
        <MudItem Class="d-flex justify-center mt-7">
            <MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Surface" Size="Size.Large" DisableElevation Style="width: 100%;" OnClick="Toggle">
                Close
            </MudButton>
        </MudItem>
    </MudStack>
</MudDrawer>

@code{
    private bool _visible;

    public void Toggle()
    {
        _visible = !_visible;
        StateHasChanged();
    }
}