@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)
{
    <legend class="font-bold text-gray-900">
        @Model.Value.Label
    </legend>
}
else if (Model.Value.Option == LabelOptions.ScreenReaders)
{
    <legend class="sr-only">
        @Model.Value.Label
    </legend>
}
