/** * MobileBottomNav - Navigation bottom fixe pour l'application mobile * 5 boutons: Accueil, Commandes, Livraisons, Tâches, Plus */ import { Link, useLocation } from "wouter"; import { useState } from "react"; import { Home, Package, Truck, CheckSquare, MoreHorizontal, Calendar, Megaphone, ShoppingCart, Clock, Wrench, Receipt } from "lucide-react"; import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet"; import { useAuthUnified } from "@/hooks/useAuthUnified"; interface NavItem { path: string; label: string; icon: React.ComponentType<{ className?: string }>; } const primaryItems: NavItem[] = [ { path: "/dashboard", label: "Accueil", icon: Home }, { path: "/orders", label: "Commandes", icon: Package }, { path: "/deliveries", label: "Livraisons", icon: Truck }, { path: "/tasks", label: "Tâches", icon: CheckSquare }, ]; const moreItems: NavItem[] = [ { path: "/calendar", label: "Calendrier", icon: Calendar }, { path: "/publicities", label: "Publicités", icon: Megaphone }, { path: "/customer-orders", label: "Cmd Client", icon: ShoppingCart }, { path: "/dlc", label: "DLC", icon: Clock }, { path: "/sav", label: "SAV", icon: Wrench }, { path: "/avoirs", label: "Avoirs", icon: Receipt }, ]; export default function MobileBottomNav() { const [location] = useLocation(); const { user } = useAuthUnified(); const [moreOpen, setMoreOpen] = useState(false); const isActive = (path: string) => { if (path === "/dashboard" && (location === "/" || location === "/dashboard")) return true; return location.startsWith(path); }; // Check if any "more" item is active const isMoreActive = moreItems.some(item => isActive(item.path)); return ( <> {/* Navigation bottom fixe */} {/* Sheet "Plus" */} Autres pages
{moreItems.map((item) => { const Icon = item.icon; const active = isActive(item.path); return ( setMoreOpen(false)} >
{item.label}
); })}
); }