@model bitforum.Models.System.Menu;

@* 좌측 메뉴 *@

<li class="nav-item">
    <a href="@Model.Path" class="nav-link"
        @Html.Raw(Model.Children != null && Model.Children.Any() ? "data-bs-toggle=\"collapse\"" : "")
        @Html.Raw(Model.Children != null && Model.Children.Any() ? $"data-bs-target=\"#menu-{Model.Id}\"" : "")
    >
        @if (!string.IsNullOrEmpty(Model.Icon))
        {
            @Html.Raw(Model.Icon);
        }

        @Model.Name
    </a>

    @if (Model.Children != null && Model.Children.Any())
    {
        <ul id="menu-@Model.Id" class="nav flex-column flex-nowrap ps-3 collapse">
            @foreach (var child in Model.Children)
            {
                @Html.Partial("_MenuItem", child);
            }
        </ul>
    }
</li>