@php
    use Illuminate\Support\Facades\Auth;

    $menus = [
        ['label' => 'Dashboard', 'route' => 'admin.dashboard', 'icon' => 'home', 'permission' => null],
        ['label' => 'Role', 'route' => 'admin.roles', 'icon' => 'user-circle', 'permission' => 'role-list'],
        ['label' => 'User', 'route' => 'admin.users', 'icon' => 'user-circle', 'permission' => 'user-list'],
        ['label' => 'Artist', 'route' => 'admin.artists', 'icon' => 'musical-note', 'permission' => 'song-list'],
        ['label' => 'Song', 'route' => 'admin.songs', 'icon' => 'musical-note', 'permission' => 'song-list'],
    ];
@endphp

<aside class="w-64 bg-white border-r">
    <div class="p-4 font-bold text-lg border-b">
        管理後台
    </div>
    <nav class="mt-4">
        @foreach ($menus as $menu)
            @if (!$menu['permission'] || Auth::user()->can($menu['permission']))
                <a href="{{ route($menu['route']) }}"
                   class="flex items-center px-4 py-2 text-gray-700 hover:bg-gray-100 {{ request()->routeIs($menu['route']) ? 'bg-gray-100 font-semibold' : '' }}">
                   <x-wireui:icon name="{{ $menu['icon'] }}" class="w-5 h-5" />
                    {{ $menu['label'] }}
                    
                </a>
            @endif
        @endforeach
    </nav>
</aside>