@unless(timebank_config('seo.allow_indexing_auth'))
@endunless
@auth
@endauth
@php
// Determine page title: explicit title > header content > fallback
$pageTitle = null;
// Check if header slot is set and extract text from it
if (isset($header) && $header) {
$headerContent = (string) $header;
$pageTitle = trim(strip_tags($headerContent));
}
// Fall back to StringHelper if no valid header content
if (empty($pageTitle)) {
$pageTitle = \App\Helpers\StringHelper::getPageTitle();
}
@endphp
@include('layouts.partials.brand-head', ['pageTitle' => $pageTitle])
{{-- --}}
@vite(['resources/css/app.css', 'resources/css/fonts.css', 'resources/sass/custom_timebank.css'])
@livewireStyles
@wirechatStyles
@vite('resources/js/quill.js')
{{-- TODO: Move styles below to separate css file, that can be compiled --}}
@php
$switchNotification = null;
// Check for query parameter first (Livewire navigate case)
if (request()->has('profile-switch-banner')) {
try {
$encoded = request('profile-switch-banner');
$switchNotification = json_decode(base64_decode($encoded), true);
// Convert photo path to URL if it exists
if ($switchNotification && !empty($switchNotification['photo'])) {
$switchNotification['photo'] = Storage::url($switchNotification['photo']);
}
// Translate role label
if ($switchNotification && !empty($switchNotification['roleLabel'])) {
$switchNotification['roleLabel'] = __($switchNotification['roleLabel']);
}
\Log::info('BANNER: Found notification in query param', ['name' => $switchNotification['name'] ?? 'unknown']);
} catch (\Exception $e) {
\Log::warning('BANNER: Failed to decode query param', ['error' => $e->getMessage()]);
}
}
// Fall back to session (for non-Livewire navigate cases like direct login)
if (!$switchNotification && session('profile-switched-notification')) {
$switchNotification = [
'name' => session('activeProfileName'),
'photo' => session('activeProfilePhoto') ? Storage::url(session('activeProfilePhoto')) : null,
'roleLabel' => session('activeProfileRoleLabel') ? __(session('activeProfileRoleLabel')) : null,
];
\Log::info('BANNER: Found notification in session', ['name' => $switchNotification['name']]);
session()->forget('profile-switched-notification');
}
if (!$switchNotification) {
\Log::info('BANNER: No notification found (query or session)');
}
@endphp
@if($switchNotification)
@endif
{{ __('You are now acting as') }}
{{-- Always-run script: checks meta tag for notification data on every page load --}}
@auth
@livewire('forced-logout-modal')
@livewire('account-info-modal')