| | | 1 | | <MudDialog> |
| | | 2 | | <TitleContent> |
| | | 3 | | <MudText Typo="Typo.h6" Color="Color.Error"> |
| | | 4 | | <MudIcon Icon="@Icons.Material.Filled.Warning" Class="mr-2" /> |
| | | 5 | | Delete Map |
| | | 6 | | </MudText> |
| | | 7 | | </TitleContent> |
| | | 8 | | <DialogContent> |
| | | 9 | | <MudText Class="mb-3"> |
| | | 10 | | This will <strong>permanently delete</strong> <em>@MapName</em>, all associated map metadata, |
| | | 11 | | and the entire map folder in blob storage. This cannot be undone. |
| | | 12 | | </MudText> |
| | | 13 | | <MudText Class="mb-2"> |
| | | 14 | | Type <strong>@MapName</strong> to confirm: |
| | | 15 | | </MudText> |
| | | 16 | | <MudTextField @bind-Value="_confirmText" |
| | | 17 | | Label="Map name" |
| | | 18 | | Variant="Variant.Outlined" |
| | | 19 | | Margin="Margin.Dense" |
| | | 20 | | Immediate="true" |
| | | 21 | | AutoFocus="true" /> |
| | | 22 | | </DialogContent> |
| | | 23 | | <DialogActions> |
| | | 24 | | <MudButton OnClick="Cancel">Cancel</MudButton> |
| | | 25 | | <MudButton Color="Color.Error" |
| | | 26 | | Variant="Variant.Filled" |
| | | 27 | | OnClick="Confirm" |
| | | 28 | | Disabled="@(!CanConfirm)" |
| | | 29 | | StartIcon="@Icons.Material.Filled.DeleteForever"> |
| | | 30 | | Delete Forever |
| | | 31 | | </MudButton> |
| | | 32 | | </DialogActions> |
| | | 33 | | </MudDialog> |
| | | 34 | | |
| | | 35 | | @code { |
| | | 36 | | [CascadingParameter] |
| | | 37 | | private MudDialogInstance? MudDialog { get; set; } |
| | | 38 | | |
| | | 39 | | [Parameter] public string MapName { get; set; } = string.Empty; |
| | | 40 | | |
| | 6 | 41 | | private string _confirmText = string.Empty; |
| | | 42 | | |
| | | 43 | | private bool CanConfirm => |
| | 9 | 44 | | string.Equals(_confirmText, MapName, StringComparison.Ordinal); |
| | | 45 | | |
| | 2 | 46 | | private void Cancel() => MudDialog?.Cancel(); |
| | 2 | 47 | | private void Confirm() => MudDialog?.Close(DialogResult.Ok(true)); |
| | | 48 | | } |