import type { ReactNode } from 'react' import { Link } from '@tanstack/react-router' import { Activity, Server, Users, KeyRound, Settings, Radio } from 'lucide-react' import { m } from '@/paraglide/messages' import { useLocale, changeLocale, locales, type Locale } from '@/lib/i18n' import { cn } from '@/lib/utils' const NAV = [ { to: '/', icon: Activity, label: () => m.nav_dashboard() }, { to: '/host', icon: Server, label: () => m.nav_host() }, { to: '/clients', icon: Users, label: () => m.nav_clients() }, { to: '/pairing', icon: KeyRound, label: () => m.nav_pairing() }, { to: '/settings', icon: Settings, label: () => m.nav_settings() }, ] as const export function AppShell({ children }: { children: ReactNode }) { // Read the locale so the whole shell re-renders on a language switch. useLocale() return (
{/* Desktop sidebar (≥ sm). */}
{/* Mobile top bar (< sm): brand + language. The sidebar is hidden here. */}
{m.app_name()}
{/* pb-24 leaves room for the fixed bottom nav on mobile. */}
{children}
{/* Mobile bottom tab bar (< sm): the primary navigation on phones. */}
) } function LanguageSwitcher() { const current = useLocale() return (
{locales.map((l: Locale) => ( ))}
) }