@vite(['resources/css/app.css', 'resources/js/app.js']) @livewireStyles @php $maintenanceWindows = collect(); if (auth()->check()) { $portalCustomer = \App\Models\Customer::query()->where('user_id', auth()->id())->first() ?? \App\Models\Customer::query()->where('email', auth()->user()->email)->first(); if ($portalCustomer) { $maintenanceWindows = \App\Models\MaintenanceWindow::bannerFor($portalCustomer); } } @endphp @if (auth()->check() && ! ($portalCustomer ?? null)) {{-- No customer behind this login (e.g. an operator account): say so, or every customer action on these pages looks like a dead button. --}}
{{ __('dashboard.no_customer_title') }} {{ __('dashboard.no_customer_hint') }} @if (auth()->user()->can('console.view')) {{ __('dashboard.no_customer_cta') }} @endif
@endif @foreach ($maintenanceWindows as $mw) @php $isActive = now()->greaterThanOrEqualTo($mw->starts_at) && now()->lessThanOrEqualTo($mw->ends_at); @endphp
{{ $mw->title }} {{ $isActive ? __('maintenance.banner_active', ['end' => $mw->ends_at->isoFormat('LT')]) : __('maintenance.banner_upcoming', ['start' => $mw->starts_at->isoFormat('LLL'), 'end' => $mw->ends_at->isoFormat('LT')]) }}
@endforeach @if (session('impersonator_id')) {{-- Admin impersonation banner — visible on every portal page until the admin returns. --}}
{{ __('impersonate.banner', ['name' => auth()->user()->name]) }}
@csrf
@endif
{{-- Sidebar: fixed drawer on small screens, fixed full-height column on large (R7). --}} {{-- Mobile backdrop --}}
@auth
@csrf
@endauth
{{ $slot }}
{{-- Global toast — any element can trigger it with $dispatch('notify', { message }) --}}
@livewire('wire-elements-modal') @livewireScripts