@using Iceshrimp.Assets.PhosphorIcons
<NavLink href="@Link.Href" class="nav-link" Match="NavLinkMatch.AllExcludingQuery" target="@Target">
    @if (Link.Icon != null)
    {
        <Icon Name="Link.Icon"/>
    }
    @Link.Name
    @if (Link.IconRight != null)
    {
        <Icon Name="Link.IconRight"/>
    }
</NavLink>

@code {
    [Parameter, EditorRequired] public required NavBar.NavLink Link   { get; set; }
    private                                     string         Target => Link.NewTab ? "_blank" : "_self";
}