Files
sam-manage/resources/views/components/sidebar/menu-tree.blade.php

34 lines
997 B
PHP
Raw Normal View History

@props(['menus', 'section' => null])
@php
// 섹션 레이블
$sectionLabels = [
'main' => null,
'tools' => '개발 도구',
'labs' => 'R&D Labs',
];
$sectionLabel = $section ? ($sectionLabels[$section] ?? null) : null;
@endphp
@if($menus->isNotEmpty())
{{-- 섹션 레이블 (tools, labs) --}}
@if($sectionLabel)
<li class="pt-6 pb-1 border-t-2 border-gray-300 mt-4">
<span class="px-3 py-2 text-xs font-bold text-primary uppercase tracking-wider sidebar-text">
{{ $sectionLabel }}
</span>
</li>
@endif
@foreach($menus as $menu)
@if($menu->menuChildren && $menu->menuChildren->isNotEmpty())
{{-- 자식 메뉴가 있으면 그룹으로 렌더링 --}}
<x-sidebar.menu-group :menu="$menu" />
@else
{{-- 자식 없으면 단일 아이템 --}}
<x-sidebar.menu-item :menu="$menu" />
@endif
@endforeach
@endif