@php // Cross-page navigation for the CRM settings pages, each a real route. // $current is passed in, because during a Livewire update the request's // route is Livewire's own. A Wave 4 page joins the strip by itself once its // session ships it, and only for people who hold its ability. $settingsUser = auth()->user(); $settingsAccess = app(\App\Services\Crm\CrmAccess::class); $settingsLive = fn (string $component, string $ability): bool => ! \App\Support\CrmNav::isComingSoon($component) && $settingsUser !== null && $settingsAccess->can($settingsUser, $ability); $settingsTabs = array_values(array_filter([ ['route' => 'crm.settings.index', 'label' => __('Thresholds and notifications'), 'icon' => 'cog-6-tooth', 'show' => true], ['route' => 'crm.settings.stages', 'label' => __('Stages and Reasons'), 'icon' => 'queue-list', 'show' => true], ['route' => 'crm.settings.lists', 'label' => __('Sectors and Sources'), 'icon' => 'tag', 'show' => true], ['route' => 'crm.settings.google', 'label' => __('Google Workspace'), 'icon' => 'link', 'show' => ! \App\Support\CrmNav::isComingSoon('Settings\\Google')], ['route' => 'crm.settings.gmail', 'label' => __('Gmail'), 'icon' => 'envelope', 'show' => $settingsLive('Settings\\Gmail', 'crm.read')], ['route' => 'crm.settings.rota', 'label' => __('Enquiry Rota'), 'icon' => 'arrow-path', 'show' => $settingsLive('Settings\\Rota', 'crm.reassign')], ['route' => 'crm.settings.scoring', 'label' => __('Lead Scoring'), 'icon' => 'star', 'show' => $settingsLive('Settings\\Scoring', 'crm.scoring')], ], fn (array $tab): bool => $tab['show'])); @endphp
@foreach ($settingsTabs as $tab) @php $active = $current === $tab['route']; @endphp $active, 'text-slate-500 hover:bg-white/70 hover:text-slate-800' => ! $active, ]) @if ($active) aria-current="page" @endif> {{ $tab['label'] }} @endforeach