"use client"; import { useState } from "react"; import { Blocks, Bot, ChevronRight, Cloud, Code, Code2, Eye, FileText, Grid2X2, Heart, Package, Palette, Plus, Shapes, Sparkles, Terminal, } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { ScrollArea } from "@/components/ui/scroll-area"; import type { Collection } from "@/lib/icons"; import { cn } from "@/lib/utils"; const EXTENSION_CATEGORIES = [ { id: "npm", label: "Libraries & SDKs", icon: Package }, { id: "editors", label: "Editor Extensions", icon: Code }, { id: "design", label: "Design Tools", icon: Palette }, { id: "developer", label: "Developer Tools", icon: Terminal }, { id: "ai", label: "AI & Automation", icon: Bot }, { id: "integrations", label: "Integrations", icon: Blocks }, { id: "frameworks", label: "Framework Components", icon: Code2 }, ]; const COLLECTION_META: Record = { brands: { icon: Shapes, label: "Brand Icons", color: "text-orange-500" }, aws: { icon: Cloud, label: "AWS Architecture", color: "text-[#ff9900]" }, azure: { icon: Cloud, label: "Azure Services", color: "text-[#0078d4]" }, gcp: { icon: Cloud, label: "Google Cloud", color: "text-[#4285f4]" }, k8s: { icon: Cloud, label: "Kubernetes", color: "text-[#326CE5]" }, }; interface SidebarProps { categories: { name: string; count: number }[]; selectedCategory: string | null; onCategorySelect: (category: string | null) => void; favoriteCount: number; showFavorites: boolean; onToggleFavorites: () => void; mobile?: boolean; collections: { name: Collection; count: number }[]; selectedCollection: Collection | null; onCollectionSelect: (collection: Collection | null) => void; } export function Sidebar({ categories, selectedCategory, onCategorySelect, favoriteCount, showFavorites, onToggleFavorites, mobile, collections, selectedCollection, onCollectionSelect, }: SidebarProps) { const pathname = usePathname(); const isExtensionsPage = pathname === "/extensions"; const [extensionsExpanded, setExtensionsExpanded] = useState(isExtensionsPage); const isFavoritesActive = showFavorites; const isAllIconsActive = !selectedCategory && !showFavorites && !selectedCollection && pathname === "/"; const navItemClass = "group flex w-full items-center gap-3 rounded-xl px-3 py-2 text-sm font-medium text-muted-foreground transition-all duration-200 hover:bg-accent/80 hover:text-accent-foreground"; const activeClass = "bg-gradient-to-r from-accent/80 to-accent/40 text-accent-foreground font-medium shadow-sm shadow-black/[0.03] dark:from-white/[0.08] dark:to-white/[0.04] dark:shadow-black/20"; return ( ); }