@props([ 'section', 'parameters' => [], 'title' => null, 'subtitle' => null, // When false (default), hide the in-flow H1 once the desktop shell is active // (lg+: main sidebar + fixed layer-2 tabs). Below lg the mobile topbar is used // and the page title stays visible. Pass true for resource-detail names. 'titleOnDesktop' => false, 'mobileTitleOnly' => false, ]) @php $items = match ($section) { 'team' => [ ['label' => 'General', 'route' => 'team.index', 'active' => request()->routeIs('team.index', 'team.member.index', 'team.admin-view', 'team.danger-zone')], ], 'profile' => [ ['label' => 'General', 'route' => 'profile', 'active' => request()->routeIs('profile')], ['label' => 'Appearance', 'route' => 'profile.appearance', 'active' => request()->routeIs('profile.appearance')], ], 'notifications' => [ ['label' => 'Email', 'route' => 'notifications.email', 'active' => request()->routeIs('notifications.*')], ], 'security' => [ ['label' => 'Private Keys', 'route' => 'security.private-key.index', 'active' => request()->routeIs('security.*')], ], 'settings' => [ ['label' => 'General', 'route' => 'settings.index', 'active' => request()->routeIs('settings.*')], ], 'source' => [ [ 'label' => 'General', 'route' => 'source.github.show', 'active' => request()->routeIs('source.github.show', 'source.github.permissions', 'source.github.resources', 'source.github.danger'), ], ], 'destination' => [ ['label' => 'General', 'route' => 'destination.show', 'active' => request()->routeIs('destination.show', 'destination.resources', 'destination.danger')], ], 'storage' => [ [ 'label' => 'General', 'route' => 'storage.show', 'active' => request()->routeIs('storage.show', 'storage.danger', 'storage.resources'), ], ], 'subscription' => [ [ 'label' => 'Plan', 'route' => 'subscription.show', 'active' => request()->routeIs('subscription.show'), 'icon' => 'subscription', // Unsubscribed accounts cannot open /subscription (middleware forces /subscription/new). 'visible' => isSubscriptionActive() || isSubscriptionOnGracePeriod(), ], [ 'label' => 'Pricing', 'route' => 'subscription.index', 'active' => request()->routeIs('subscription.index'), 'icon' => 'dashboard', // Active subscriptions are redirected away from pricing by middleware. 'visible' => ! isSubscriptionActive(), ], ], default => [], }; $items = array_values(array_filter($items, fn (array $item): bool => $item['visible'] ?? true)); // A single self-link tab (e.g. only "Pricing" on /subscription/new) is not navigation. $showTabs = count($items) >= 2; $hasTitle = filled($title); $hasActions = isset($actions); $showNav = $showTabs || $hasActions; @endphp @if ($hasTitle)
$titleOnDesktop || ! $showNav, // Hide with the desktop chrome (sidebar + fixed tabs), not xl. // Keep title on desktop when there is no fixed layer-2 tab strip. 'lg:hidden' => $mobileTitleOnly || (! $titleOnDesktop && $showNav), ])>

{{ $title }}

@isset($titleMeta)
{{ $titleMeta }}
@endisset
@if (filled($subtitle))

{{ $subtitle }}

@endif
@isset($titleActions)
{{ $titleActions }}
@endisset
@if ($showNav)
@endif @endif @if ($showNav) @endif @if ($hasTitle) @if ($showNav)
@endif
@endif