{{-- Full-width impersonation banner — sticky top, visible on every panel (tenant + super admin). Single source of truth for the "you are impersonating" state. Replaces the old pair of banners that both POSTed to the same stop route. --}} @if(session()->has('impersonating_from')) @php $tenantId = session('impersonating_tenant_id'); $tenant = $tenantId ? \App\Models\Tenant::find($tenantId) : null; $tenantName = $tenant?->name ?? __('filament/impersonation_bar.tenant_fallback_name'); $ownerName = $tenant?->owner?->name ?? null; $ownerEmail = $tenant?->owner?->email ?? null; $startedAt = session('impersonating_started_at'); $startedLabel = $startedAt ? \Carbon\Carbon::parse($startedAt)->diffForHumans() : ''; @endphp {{-- Inline styles + bar. Uses :has() to push Filament notifications BELOW the bar so they're not obscured by it. JS fallback tags with `has-impersonation-bar` for browsers that don't support :has() yet. --}}
{{-- Warning icon --}}
{{ __('filament/impersonation_bar.label_active') }}  ·  {{ __('filament/impersonation_bar.viewing_prefix') }} {{ e($tenantName) }}@if($ownerName) {{ __('filament/impersonation_bar.as_connector') }} {{ e($ownerName) }}@if($ownerEmail) ({{ e($ownerEmail) }})@endif @endif @if($startedLabel)· {{ __('filament/impersonation_bar.started_prefix', ['time' => $startedLabel]) }}@endif · {{ __('filament/impersonation_bar.actions_disclosure') }}
@csrf
@endif