@inherits MSGComponentBase

<MudDialog>
    <DialogContent>
        <MudJustifiedText Typo="Typo.body1" Class="mb-3">
            @T("Review the assistant draft before AI Studio generates the Lua plugin. You can edit the Markdown draft if something should be changed.")
        </MudJustifiedText>

        <MudTabs Elevation="0" Rounded="true" ApplyEffectsToContainer="true" Outlined="true" PanelClass="pa-2" Class="mb-2">
            <MudTabPanel Text="@T("Preview")" Icon="@Icons.Material.Filled.Article">
                <MudField Variant="Variant.Outlined" AdornmentIcon="@Icons.Material.Filled.Visibility" Adornment="Adornment.Start" Label="@T("Assistant draft")" FullWidth="true" Class="ma-2 pe-4">
                    <div style="max-height: 58vh; overflow-y: auto;">
                        <MudMarkdown Value="@this.DraftMarkdown" Props="Markdown.DefaultConfig" Styling="@this.MarkdownStyling" MarkdownPipeline="Markdown.SAFE_MARKDOWN_PIPELINE"/>
                    </div>
                </MudField>
            </MudTabPanel>
            <MudTabPanel Text="@T("Edit")" Icon="@Icons.Material.Filled.Edit">
                <MudTextField T="string" @bind-Text="@this.DraftMarkdown" AdornmentIcon="@Icons.Material.Filled.EditNote" Adornment="Adornment.Start" Label="@T("Assistant draft Markdown")" Variant="Variant.Outlined" Lines="16" AutoGrow="@true" MaxLines="32" Class="ma-2"/>
            </MudTabPanel>
        </MudTabs>
    </DialogContent>
    <DialogActions>
        <MudButton OnClick="@this.Cancel" Variant="Variant.Filled">
            @T("Cancel")
        </MudButton>
        <MudButton OnClick="@this.Confirm" Variant="Variant.Filled" Color="Color.Primary">
            @T("Use this draft")
        </MudButton>
    </DialogActions>
</MudDialog>
