@namespace BootstrapBlazor.Components
@inherits BootstrapComponentBase

<a @attributes="@AdditionalAttributes" class="@ClassString">
    <i class="@GetIconString"></i>
    <span class="text">@Item.Text</span>
    <i class="@DropdownIconString"></i>
    <ul class="nav sub-menu">
        @foreach (var item in Item.Items)
        {
            <li class="@GetClassString(item)">
                @if (item.Items.Any() && !item.IsDisabled)
                {
                    <SubMenu Item="@item" OnClick="OnClickItem" />
                }
                else
                {
                    <div class="nav-item" @onclick:stopPropagation @onclick="() => OnClickItem(item)">
                        <MenuLink Item="@item" ArrowIcon="@ArrowIcon" />
                    </div>
                }
            </li>
        }
    </ul>
</a>
