@using static HotelPms.Client.Blazor.Util.SystemEnum
|
<MudDialog Style="width: 300px;">
|
<TitleContent>
|
<MudText Typo="Typo.h6">
|
<MudIcon Icon="@Icons.Material.Filled.Info" Class="mr-3 mb-n1"/>
|
@Title
|
</MudText>
|
</TitleContent>
|
<DialogContent>
|
<MudGrid Justify="Justify.FlexStart" Class="align-center my-n3">
|
@foreach(string item in Data)
|
{
|
<MudItem xs="12" Class="py-1">
|
<MudText Color="@Color.Default">@item</MudText>
|
</MudItem>
|
}
|
</MudGrid>
|
</DialogContent>
|
<DialogActions>
|
<MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
|
<MudItem>
|
<MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Error" OnClick="Save" StartIcon="@Icons.Filled.Done" Style="width: 100px; height: 40px;">@GetText1()</MudButton>
|
</MudItem>
|
@if (MsgType == EMessageType.OKCancel || MsgType == EMessageType.YesNo)
|
{
|
<MudItem>
|
<MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Close" StartIcon="@Icons.Filled.Close" Style="width: 100px; height: 40px;">@GetText2()</MudButton>
|
</MudItem>
|
}
|
</MudGrid>
|
</DialogActions>
|
</MudDialog>
|
|
@code {
|
[CascadingParameter] MudDialogInstance MudDialog { get; set; }
|
[Parameter] public EMessageType MsgType { get; set; }
|
[Parameter] public string Title { get; set; }
|
[Parameter] public List<string> Data { get; set; }
|
|
private string GetText1()
|
{
|
return MsgType == EMessageType.YesNo ? "はい" : "OK";
|
}
|
|
private string GetText2()
|
{
|
return MsgType == EMessageType.YesNo ? "いいえ" : "キャンセル";
|
}
|
|
private void Close()
|
{
|
MudDialog.Cancel();
|
}
|
|
private void Save()
|
{
|
MudDialog.Close(DialogResult.Ok("OK"));
|
}
|
}
|