@* Components/NavRailItem.razor *@
@namespace ZB.MOM.WW.Theme
<NavLink class="rail-link" href="@Href" Match="@Match" ActiveClass="active">
    @if (Icon is not null) { <span class="rail-ico">@Icon</span> }
    @Text
</NavLink>

@code {
    /// <summary>Link target (the <c>href</c> of the underlying <c>NavLink</c>). Required.</summary>
    [Parameter, EditorRequired] public string Href { get; set; } = string.Empty;

    /// <summary>Visible label text for the rail link. Required.</summary>
    [Parameter, EditorRequired] public string Text { get; set; } = string.Empty;

    /// <summary>
    /// Optional leading icon, rendered in a <c>.rail-ico</c> span before the label.
    /// </summary>
    [Parameter] public RenderFragment? Icon { get; set; }

    /// <summary>
    /// Active-class matching behaviour passed to the underlying <c>NavLink</c>.
    /// Defaults to <see cref="NavLinkMatch.Prefix"/>; use <see cref="NavLinkMatch.All"/>
    /// for exact matches such as the home/overview link.
    /// </summary>
    [Parameter] public NavLinkMatch Match { get; set; } = NavLinkMatch.Prefix;
}
