1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-11-24 22:42:53 +01:00
Minecraft-Phantom-Panel/Server/Phantom.Server.Web.Components/Forms/FormLabel.razor

25 lines
547 B
Plaintext

@using Phantom.Server.Web.Components.Utils
@if (Label != null) {
<label for="@Id" class="form-label">@Label</label>
}
else if (LabelFragment != null) {
<label for="@Id" class="form-label">@LabelFragment</label>
}
@code {
[Parameter, EditorRequired]
public string Id { get; set; } = null!;
[Parameter]
public string? Label { get; set; }
[Parameter]
public RenderFragment? LabelFragment { get; set; }
protected override void OnParametersSet() {
BlazorUtils.RequireEitherParameterIsSet(Label, LabelFragment);
}
}