using TaxBaik.WasmClient.Components.Admin.Shared;

namespace MudBlazor;

public static class MudDialogServiceCompatExtensions
{
    public static async Task<bool?> ShowMessageBox(
        this IDialogService dialogService,
        string title,
        string message,
        string yesText = "확인",
        string? cancelText = null)
    {
        var parameters = new DialogParameters
        {
            { "Title", title },
            { "Message", message }
        };

        var dialog = await dialogService.ShowAsync<ConfirmDialog>(title, parameters);
        var result = await dialog.Result;
        return result?.Canceled == false ? true : false;
    }
}
