RobotNet/RobotNet.WebApp/Scripts/Components/ActionButton.razor
2025-10-15 15:15:53 +07:00

32 lines
686 B
Plaintext

<MudTooltip Text="@Tooltip" Delay="500">
<button type="button" class="@Class" @onclick="Click">
<span class="mdi @Icon"></span>
</button>
</MudTooltip>
@code {
[Parameter]
public string Icon { get; set; } = "mdi-alpha";
[Parameter]
public string Tooltip { get; set; } = "";
[Parameter]
public bool Large { get; set; }
[Parameter]
public bool Disabled { get; set; }
[Parameter]
public EventCallback OnClick { get; set; }
public string Class => $"{(Large ? "large" : "")} {(Disabled ? "disabled" : "")}";
private async Task Click()
{
if (Disabled) return;
await OnClick.InvokeAsync();
}
}