'use client' import { useState } from 'react' import Link from 'next/link' import { usePathname, useSearchParams } from 'next/navigation' import { cn } from '@/lib/utils' import { StickyNote, Bell, Archive, Trash2, Tag, ChevronDown, ChevronUp, Settings } from 'lucide-react' import { useLabels } from '@/context/LabelContext' import { LabelManagementDialog } from './label-management-dialog' import { LABEL_COLORS } from '@/lib/types' export function Sidebar({ className }: { className?: string }) { const pathname = usePathname() const searchParams = useSearchParams() const { labels, getLabelColor } = useLabels() const [isLabelsExpanded, setIsLabelsExpanded] = useState(false) const currentLabels = searchParams.get('labels')?.split(',').filter(Boolean) || [] const currentSearch = searchParams.get('search') // Show first 5 labels by default, or all if expanded const displayedLabels = isLabelsExpanded ? labels : labels.slice(0, 5) const hasMoreLabels = labels.length > 5 const NavItem = ({ href, icon: Icon, label, active, onClick, iconColorClass }: any) => ( {label} ) return ( ) }