@using OrchardCore.Forms.ViewModels
@using OrchardCore.Forms.Models
@model ShapeViewModel<FormElementLabelPart>
@{
    var formElementPart = Model.Value.ContentItem.As<FormElementPart>();
    var formInputElementPart = Model.Value.ContentItem.As<FormInputElementPart>();
    var elementId = formElementPart.Id;
    var fieldName = formInputElementPart.Name;
    var fieldId = !string.IsNullOrEmpty(elementId) ? elementId : !string.IsNullOrEmpty(fieldName) ? Html.GenerateIdFromName(fieldName) : default(string);
}

@if (Model.Value.Option == LabelOptions.Standard)
{
    <label for="@fieldId" class="block mt-2 font-bold text-gray-900">@Model.Value.Label</label>
}
else if (Model.Value.Option == LabelOptions.ScreenReaders)
{
    <label for="@fieldId" class="sr-only">@Model.Value.Label</label>
}
