@namespace ZB.MOM.WW.Theme
@* Components/TechField.razor *@
<div class="tech-field mb-3">
    <label class="form-label">@Label</label>
    @ChildContent
    @if (!string.IsNullOrEmpty(Hint)) { <div class="form-text">@Hint</div> }
    @if (!string.IsNullOrEmpty(Error)) { <div class="field-error s-bad">@Error</div> }
</div>

@code {
    /// <summary>Field label text. Required.</summary>
    [Parameter, EditorRequired] public string Label { get; set; } = string.Empty;

    /// <summary>Optional hint text rendered as <c>.form-text</c> below the input.</summary>
    [Parameter] public string? Hint { get; set; }

    /// <summary>
    /// Optional inline error message rendered as <c>.field-error.s-bad</c> below the input.
    /// </summary>
    [Parameter] public string? Error { get; set; }

    /// <summary>The control itself — an <c>&lt;input&gt;</c>, <c>&lt;select&gt;</c>, etc.</summary>
    [Parameter] public RenderFragment? ChildContent { get; set; }
}
