'use client' import { useAos, type ViewId } from '@/store/aos' import { LayoutDashboard, Radar, FolderKanban, Bell, Menu } from 'lucide-react' import { cn } from '@/lib/utils' import { useFetch } from '@/hooks/use-fetch' // Mobile bottom navigation bar (PRD ยง9: "Mobile: usable PWA for time tracking, // approvals and quick CRM lookups"). Shows on mobile only (md:hidden). // Provides 5 quick-access destinations optimized for touch. export function MobileBottomNav() { const { view, setView, setSidebarOpen, setCommandOpen } = useAos() const { data } = useFetch<{ stats: { total: number; urgent: number } }>('/api/aos/notifications') const urgent = data?.stats.urgent ?? 0 const total = data?.stats.total ?? 0 const items: { id: string; label: string; icon: typeof LayoutDashboard; badge?: number }[] = [ { id: 'dashboard', label: 'Home', icon: LayoutDashboard }, { id: 'leads', label: 'Leads', icon: Radar }, { id: 'search', label: 'Suche', icon: Menu }, { id: 'projects', label: 'Zeit', icon: FolderKanban }, { id: 'notifications', label: 'Alerts', icon: Bell, badge: urgent > 0 ? urgent : total > 0 ? total : undefined }, ] const handleClick = (id: string) => { if (id === 'search') setCommandOpen(true) else if (id === 'notifications') setView('calendar') else if (id === 'menu') setSidebarOpen(true) else setView(id as ViewId) } return ( ) }