'use client'; import { Box } from '@/ui/Box'; import { Text } from '@/ui/Text'; import { Search, Bell, User, ChevronDown, Command } from 'lucide-react'; import { usePathname } from 'next/navigation'; import { useCurrentSession } from '@/hooks/auth/useCurrentSession'; import { routes } from '@/lib/routing/RouteConfig'; import { Button } from '@/ui/Button'; import { useState, useEffect } from 'react'; import { AppShellBar } from './AppShellBar'; export function AppHeader() { const pathname = usePathname(); const { data: session } = useCurrentSession(); const isAuthenticated = !!session; // Simple breadcrumb logic const pathSegments = pathname.split('/').filter(Boolean); const breadcrumbs = pathSegments.length > 0 ? pathSegments.map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(' / ') : 'Home'; // Clock const [time, setTime] = useState(''); useEffect(() => { const updateTime = () => { const now = new Date(); setTime(now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false })); }; updateTime(); const interval = setInterval(updateTime, 60000); return () => clearInterval(interval); }, []); return ( {/* Left: Context & Search */} {breadcrumbs} {/* Command Search - Refined */} K {/* Right: System Status & User */} {/* System Time */} {time} UTC {/* Notifications */} {/* User Menu */} {isAuthenticated ? ( {session.user.displayName || 'Driver'} ) : ( )} ); }