@php $items = $items ?? []; $active = $active ?? null; $mode = $mode ?? 'side'; $isShop = $isShop ?? false; $title = $title ?? null; // 현재 활성화된 아이템 찾기 $activeItem = collect($items)->first(function($it) use ($active, $isShop) { if($isShop) return $active == $it['id']; return $active === ($it['key'] ?? $it['url']); }); if (!$activeItem && $isShop) { foreach($items as $it) { if(!empty($it['children'])) { $child = collect($it['children'])->firstWhere('id', $active); if($child) { $activeItem = $child; break; } } } } @endphp @if($mode === 'tabs') {{-- 모바일 전용: 한 줄에 2개씩 배치되는 그리드 디자인 --}} @else {{-- 데스크톱 전용: 프리미엄 사이드바 (기존 유지) --}} @endif