@namespace BootstrapBlazor.Components
@inherits BootstrapComponentBase

@if (Item.IsDisabled)
{
    <div class="nav-link disabled">
        @RenderSubMenu
    </div>
}
else
{
    <NavLink @attributes="@AdditionalAttributes" @onclick:preventDefault="@PreventDefault" class="@ClassString" href="@HrefString" target="@TargetString" Match="@Item.Match" style="@StyleClassString" aria-expanded="@AriaExpandedString">
        @RenderSubMenu
        @if (Item.Template != null)
        {
            <div class="widget" @onclick:stopPropagation @onclick:preventDefault>
                @Item.Template
            </div>
        }
        <i class="@MenuArrowClassString" />
    </NavLink>
}

@code {
    RenderFragment RenderSubMenu =>
    @<div class="submenu-link">
        <i class="@IconString"></i>
        <span class="menu-text">@Item.Text</span>
    </div>;
}
