26 lines
1.1 KiB
PHP

<nav class="mb-6 flex flex-wrap items-center gap-3 rounded-xl border border-gray-200 bg-white p-3 shadow-sm" aria-label="系统设置">
@php
$items = [
['system-settings.users.index', '用户管理', 'people'],
['system-settings.sidebar.edit', '侧边栏管理', 'menu'],
['system-settings.databases.index', '数据库管理', 'storage'],
];
@endphp
@foreach ($items as [$routeName, $label, $icon])
@php $active = request()->routeIs(Str::beforeLast($routeName, '.') . '.*'); @endphp
<a
href="{{ route($routeName) }}"
@class([
'inline-flex items-center gap-2 rounded-lg px-4 py-2.5 text-sm font-semibold transition-colors',
'bg-purple-700 text-white' => $active,
'text-gray-600 hover:bg-purple-100 hover:text-purple-700' => ! $active,
])
@if ($active) aria-current="page" @endif
>
<span class="material-icons-outlined text-lg" aria-hidden="true">{{ $icon }}</span>
{{ $label }}
</a>
@endforeach
</nav>