"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { LayoutDashboard, Bug, BookOpen, AlertTriangle, Users, LogOut, Grape, ChevronLeft, ChevronRight, } from "lucide-react"; import { cn } from "@/lib/utils"; import { signOut } from "@/lib/auth-client"; import { Avatar, AvatarFallback } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; interface SidebarProps { collapsed?: boolean; onCollapse?: () => void; userName?: string; userEmail?: string; } const NAV_ITEMS = [ { section: "Principal", items: [ { label: "Tableau de bord", href: "/dashboard", icon: LayoutDashboard }, ], }, { section: "Contenu", items: [ { label: "Maladies", href: "/diseases", icon: Bug }, { label: "Guides", href: "/guides", icon: BookOpen }, { label: "Alertes", href: "/alerts", icon: AlertTriangle }, ], }, { section: "Gestion", items: [ { label: "Utilisateurs", href: "/users", icon: Users }, ], }, ]; export default function Sidebar({ collapsed = false, onCollapse, userName = "Admin", userEmail = "admin@vineye.app", }: SidebarProps) { const pathname = usePathname(); function handleSignOut() { signOut({ fetchOptions: { onSuccess: () => { window.location.href = "/login"; } } }); } return ( ); }