'use client' import { useState } from 'react' import { cn } from '@/lib/utils' import { colors } from '@/lib/theme' import type { DocNavigation, DocCategory } from '@/lib/docs/types' import { Settings, Wrench, FileText, Palette, Globe, Package, ChevronDown, ChevronRight, X, Smartphone, Network, BookOpen } from 'lucide-react' import type { LucideIcon } from 'lucide-react' interface DocsSidebarProps { navigation: DocNavigation currentItemId?: string className?: string onClose?: () => void } const categoryIcons: Record = { Services: Settings, Utils: Wrench, Types: FileText, Theme: Palette, Devices: Smartphone, Domains: Network, Docs: BookOpen, API: Globe, Other: Package, } export default function DocsSidebar({ navigation, currentItemId, className, onClose, }: DocsSidebarProps) { const [expandedSections, setExpandedSections] = useState>( new Set(navigation.sections.map((s) => s.title)) ) const isMobileDrawer = !!onClose const toggleSection = (title: string) => { const newExpanded = new Set(expandedSections) if (newExpanded.has(title)) { newExpanded.delete(title) } else { newExpanded.add(title) } setExpandedSections(newExpanded) } return ( ) }