@props([ 'active' => false, 'collapsible' => true, 'icon' => null, 'items' => [], 'label' => null, 'sidebarCollapsible' => true, 'subNavigation' => false, ]) @php $sidebarCollapsible = $sidebarCollapsible && filament()->isSidebarCollapsibleOnDesktop(); $hasDropdown = filled($label) && filled($icon) && $sidebarCollapsible; @endphp
  • class([ 'fi-sidebar-group flex flex-col gap-y-1', 'fi-active' => $active, ]) }} > @if ($label)
    $collapsible, ]) > @if ($icon) @endif {{ $label }} @if ($collapsible) @endif
    @endif @if ($hasDropdown) @php $lists = []; foreach ($items as $item) { if ($childItems = $item->getChildItems()) { $lists[] = [ $item, ...$childItems, ]; $lists[] = []; continue; } if (empty($lists)) { $lists[] = [$item]; continue; } $lists[count($lists) - 1][] = $item; } if (empty($lists[count($lists) - 1])) { array_pop($lists); } @endphp @if (filled($label)) {{ $label }} @endif @foreach ($lists as $list) @foreach ($list as $item) @php $itemIsActive = $item->isActive(); @endphp {{ $item->getLabel() }} @endforeach @endforeach @endif