"use client"; import { LayoutGrid, Camera, FileDown, Settings, Package, BarChart3, LogOut, User as UserIcon } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; import { useGridStore } from "@/features/grid/store/use-grid-store"; import { useEffect, useState } from "react"; import { useSession, signOut } from "next-auth/react"; const NAV_ITEMS = [ { icon: LayoutGrid, label: "Grille", href: "/grid" }, { icon: Camera, label: "Snapshots", href: "/snapshots" }, { icon: FileDown, label: "Exports", href: "/exports" }, { icon: BarChart3, label: "Score", href: "/score" }, { icon: Settings, label: "Paramètres", href: "/settings", adminOnly: true }, ]; export function Sidebar() { const pathname = usePathname(); const { data: session } = useSession(); const activeGridQuery = useGridStore((s) => s.activeGridQuery); const [isMounted, setIsMounted] = useState(false); useEffect(() => { setIsMounted(true); }, []); const userRole = (session?.user as any)?.role; const filteredItems = NAV_ITEMS.filter(item => !item.adminOnly || userRole === "admin"); return ( ); }