@namespace ZB.MOM.WW.Theme
@* Components/TechCard.razor *@
<section class="panel @Class">
    @if (Header is not null) { <div class="panel-head">@Header</div> }
    else if (!string.IsNullOrEmpty(Title)) { <div class="panel-head">@Title</div> }
    <div class="panel-body">@ChildContent</div>
    @if (Footer is not null) { <div class="panel-foot">@Footer</div> }
</section>

@code {
    /// <summary>
    /// Optional string title rendered in the panel header. Ignored when <see cref="Header"/>
    /// is supplied (<see cref="Header"/> takes precedence).
    /// </summary>
    [Parameter] public string? Title { get; set; }

    /// <summary>
    /// Optional custom panel header content. Takes precedence over <see cref="Title"/>.
    /// </summary>
    [Parameter] public RenderFragment? Header { get; set; }

    /// <summary>Panel body content.</summary>
    [Parameter] public RenderFragment? ChildContent { get; set; }

    /// <summary>Optional panel footer content (padded, top-bordered).</summary>
    [Parameter] public RenderFragment? Footer { get; set; }

    /// <summary>Additional CSS classes appended to the root <c>&lt;section class="panel"&gt;</c>.</summary>
    [Parameter] public string? Class { get; set; }
}
