@using Blazored.Modal
@using Blazored.Modal.Services
@inherits LayoutComponentBase

<div class="modal-body">
    <h5>@Title</h5>
    <p>@Message</p>
</div>
<div class="modal-footer">
    <button class="btn btn-secondary" @onclick="Cancel">Cancelar</button>
    <button class="btn btn-primary" @onclick="Confirm">Confirmar</button>
</div>

@code {
    [CascadingParameter] BlazoredModalInstance ModalInstance { get; set; }

    [Parameter] public string Title { get; set; } = string.Empty;
    [Parameter] public string Message { get; set; } = string.Empty;

    private async Task Confirm()
    {
        await ModalInstance.CloseAsync(ModalResult.Ok(true));
    }

    private async Task Cancel()
    {
        await ModalInstance.CancelAsync();
    }
}

