first commit -push
This commit is contained in:
31
RobotNet.WebApp/Scripts/Components/ActionButton.razor
Normal file
31
RobotNet.WebApp/Scripts/Components/ActionButton.razor
Normal file
@@ -0,0 +1,31 @@
|
||||
<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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user