"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Menu, X } from "lucide-react"; import { useState } from "react"; import Logo from "@/components/Logo"; export interface NavItem { label: string; href: string; icon: React.ReactNode; color: string; } interface DashboardSidebarProps { navItems: NavItem[]; title: string; subtitle: string; colorStyles?: Record; } const defaultColorStyles: Record = { darkblue: "bg-gradient-to-r from-[#1e3a5f] to-[#2d5a8f] text-white shadow-lg shadow-blue-900/30", blue: "bg-gradient-to-r from-blue-600 to-indigo-600 text-white shadow-lg shadow-blue-500/30", green: "bg-gradient-to-r from-green-600 to-green-700 text-white shadow-lg shadow-green-500/30", emerald: "bg-gradient-to-r from-emerald-600 to-teal-600 text-white shadow-lg shadow-emerald-500/30", purple: "bg-gradient-to-r from-purple-600 to-pink-600 text-white shadow-lg shadow-purple-500/30", indigo: "bg-gradient-to-r from-indigo-600 to-purple-600 text-white shadow-lg shadow-indigo-500/30", amber: "bg-gradient-to-r from-amber-500 to-orange-600 text-white shadow-lg shadow-amber-500/30", }; export default function DashboardSidebar({ navItems, title, subtitle, colorStyles = defaultColorStyles, }: DashboardSidebarProps) { const pathname = usePathname(); const [isOpen, setIsOpen] = useState(false); const isActive = (href: string) => pathname === href; const getActiveStyles = (color: string) => { return colorStyles[color] || colorStyles.blue || defaultColorStyles.blue; }; return ( <> {/* Mobile menu button */} {/* Overlay for mobile */} {isOpen && (
setIsOpen(false)} /> )} {/* Sidebar */} ); }