"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; } export interface SidebarProps { navItems: NavItem[]; title: string; subtitle: string; activeStyles: Record; } export function SharedSidebar({ navItems, title, subtitle, activeStyles }: SidebarProps) { const pathname = usePathname(); const [isOpen, setIsOpen] = useState(false); const isActive = (href: string) => pathname === href; const getActiveStyles = (color: string) => { return activeStyles[color] || activeStyles[Object.keys(activeStyles)[0]]; }; return ( <> {/* Mobile menu button */} {/* Overlay for mobile */} {isOpen && (
setIsOpen(false)} /> )} {/* Sidebar */} ); }