@props(['title' => 'Dashboard']) {{-- Slim 64px top strip for the sidebar layout — breadcrumb + jump-search + notifications + user menu. NO nav menu here (all nav lives in the sidebar). Height is EXACTLY 64px (h-16) so full-height pages using calc(100vh-64px) stay exact. --}} @php // NEVER assume there is a user. This component renders inside the user // layout, which also wraps error pages — so a request whose session has // just expired (or an exception rendered after logout) reaches here with // auth() empty. Reading ->name on null threw a ViewException that replaced // the real page with a 500, hiding whatever the actual problem was. The // sibling components already use `?->`; this one did not. $u = auth()->user(); $uName = trim((string) ($u?->name ?? '')); $uIsAdmin = (bool) ($u?->isAdmin() ?? false); // Build the "jump to" index from the sidebar nav so search covers exactly // the pages this user can reach — plus a few always-there destinations. $jump = []; foreach (\App\Support\UserNav::groups() as $g) { foreach ($g['items'] as $it) { $jump[] = ['label' => $it['label'], 'href' => $it['href'], 'group' => $g['label']]; } } foreach ([ ['Account', url('/account')], ['Settings', url('/settings')], ['Wallet', url('/account?tab=wallet')], ['Notifications', url('/notifications')], ] as [$l, $h]) { $jump[] = ['label' => __($l), 'href' => $h, 'group' => __('Account')]; } // Workspace switcher — moved up from the sidebar into this top strip. $ws = $u?->currentWorkspace; $wsName = $ws?->name ?: brand_name(); $wsInitials = \Illuminate\Support\Str::of($wsName)->trim()->limit(2, '')->upper()->__toString(); $planLabel = $ws?->billingPackage()?->pname ?: __('Free'); $__lockWs = ($isTenantDomain ?? false); $allWorkspaces = ($u && !$__lockWs) ? $u->workspaces()->orderByDesc('last_active_at')->get() : collect(); $canCreateWorkspace = ($u && !$__lockWs) ? $u->canCreateWorkspace() : false; @endphp
{{-- Mobile: open sidebar drawer --}}
{{ $title }}
{{-- Global "jump to" search — filters the nav and Enter opens the top match. --}} {{-- Workspace switcher — where the greeting used to be (moved up from the sidebar). Dropdown wired by the layout's [data-ws-toggle] JS. --}} {{-- Spacer for < lg (where the switcher is hidden) so controls stay flush right. --}}
{{-- Theme toggle --}} {{-- Notification bell + dropdown (feed from /notifications/recent) --}}
{{-- User menu --}}