@props(['s'])
@php
// Defensive guard: skip the whole entry if its `list` route isn't
// registered. The sidebar config lists every admin surface (incl.
// optional ones like the AI dashboard) but production may be on a
// commit where some controllers haven't been deployed yet — the
// page should not 500 just because a sidebar link points to a
// future route.
if (empty($s['list']) || ! \Illuminate\Support\Facades\Route::has($s['list'])) {
return;
}
$active = request()->routeIs($s['route']);
// `create` is optional even when supplied — drop the link if its
// route is also missing rather than crashing the group.
$hasCreate = ! empty($s['create']) && \Illuminate\Support\Facades\Route::has($s['create']);
@endphp
@if (($s['mode'] ?? 'direct') === 'direct')