import { useLocation } from 'react-router-dom'; import { LogOut } from 'lucide-react'; import { t } from '@/lib/i18n'; import type { Locale } from '@/lib/i18n'; import { useLocaleContext } from '@/App'; import { useAuth } from '@/hooks/useAuth'; const routeTitles: Record = { '/': 'nav.dashboard', '/agent': 'nav.agent', '/tools': 'nav.tools', '/cron': 'nav.cron', '/integrations': 'nav.integrations', '/memory': 'nav.memory', '/config': 'nav.config', '/cost': 'nav.cost', '/logs': 'nav.logs', '/doctor': 'nav.doctor', }; const localeCycle: Locale[] = ['en', 'tr', 'zh-CN']; export default function Header() { const location = useLocation(); const { logout } = useAuth(); const { locale, setAppLocale } = useLocaleContext(); const titleKey = routeTitles[location.pathname] ?? 'nav.dashboard'; const pageTitle = t(titleKey); const toggleLanguage = () => { const currentIndex = localeCycle.indexOf(locale); const nextLocale = localeCycle[(currentIndex + 1) % localeCycle.length] ?? 'en'; setAppLocale(nextLocale); }; return (
{/* Page title */}

{pageTitle}

{/* Right-side controls */}
{/* Language switcher */} {/* Logout */}
); }