diff --git a/src/components/admin/AdminSidebar.tsx b/src/components/admin/AdminSidebar.tsx new file mode 100644 index 0000000..d55e20b --- /dev/null +++ b/src/components/admin/AdminSidebar.tsx @@ -0,0 +1,73 @@ +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { signOut } from "next-auth/react"; +import { + LayoutDashboard, + Users, + FolderOpen, + Tag, + TrendingUp, + BookOpen, + Settings, + LogOut, +} from "lucide-react"; + +const NAV_ITEMS = [ + { href: "/admin", label: "Dashboard", icon: LayoutDashboard, exact: true }, + { href: "/admin/clients", label: "Clienti", icon: Users }, + { href: "/admin/projects", label: "Progetti", icon: FolderOpen }, + { href: "/admin/offers", label: "Offerte", icon: Tag }, + { href: "/admin/forecast", label: "Forecast", icon: TrendingUp }, + { href: "/admin/catalog", label: "Catalogo", icon: BookOpen }, + { href: "/admin/impostazioni", label: "Impostazioni", icon: Settings }, +]; + +export function AdminSidebar() { + const pathname = usePathname(); + + const isActive = (href: string, exact?: boolean) => + exact ? pathname === href : pathname === href || pathname.startsWith(href + "/"); + + return ( + + ); +}