'use client'; /** * Documentation Sidebar - Production Version * * Based on Variant A with FIXED active states * * Key Improvements: * - Consistent active state styling for both parent and child items * - Clean left border indicator (no background boxes) * - Parent active: purple left border + white text * - Child active: purple left border + white text (NO background) * * Features: * - Thin sidebar with subtle hover states * - Collapsible section groups * - Minimal icons (chevron for expandable items) * - Clean, uncluttered appearance * * Navigation Structure: * - Getting Started * - API Reference (collapsible): Generation, Advanced, Upload, Images, Live URLs * - Guides (collapsible): Authentication, API Keys */ import { useState } from 'react'; interface NavItem { label: string; href: string; icon?: string; children?: NavItem[]; } interface DocsSidebarProps { currentPath: string; } const navigationItems: NavItem[] = [ { label: 'Getting Started', href: '/docs', icon: '🚀', }, { label: 'API Reference', href: '/docs/api', icon: '📚', children: [ { label: 'Image Generation', href: '/docs/api/generate' }, { label: 'Advanced Generation', href: '/docs/api/advanced' }, { label: 'Image Upload', href: '/docs/api/upload' }, { label: 'Image Management', href: '/docs/api/images' }, { label: 'Live URLs', href: '/docs/api/live' }, ], }, ]; export const DocsSidebar = ({ currentPath }: DocsSidebarProps) => { const [expandedSections, setExpandedSections] = useState(['API Reference']); const toggleSection = (label: string) => { setExpandedSections((prev) => prev.includes(label) ? prev.filter((item) => item !== label) : [...prev, label] ); }; const isActive = (href: string) => currentPath === href; const isExpanded = (label: string) => expandedSections.includes(label); return ( ); };