Files
aliasvault/apps/server/Shared/AliasVault.RazorComponents/Buttons/CancelButton.razor
2025-04-30 19:03:18 +02:00

27 lines
595 B
Plaintext

<Button OnClick="HandleClick"
Color="danger">
@ChildContent
</Button>
@code {
/// <summary>
/// The event to call in the parent when the cancel button is clicked.
/// </summary>
[Parameter]
public EventCallback OnClick { get; set; }
/// <summary>
/// The content to be displayed inside the button.
/// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }
/// <summary>
/// Handles the button click event.
/// </summary>
private async Task HandleClick()
{
await OnClick.InvokeAsync();
}
}