'use client' /** * Release Sidebar Navigation * * Fixed sidebar with grouped list of all releases * Auto-generated from MDX files */ import Link from 'next/link' import { usePathname } from 'next/navigation' import { ChevronRight, ChevronDown, ChevronLeft, X } from 'lucide-react' import { useState, useEffect } from 'react' import type { ReleaseNote, GroupMetadata, CategoryMetadata, TocItem } from '@/lib/mdx/documentatie' interface ReleaseSidebarProps { releases: ReleaseNote[] metadata: { groups: GroupMetadata[] categories: CategoryMetadata[] } tocMap: Record } export function ReleaseSidebar({ releases, metadata, tocMap }: ReleaseSidebarProps) { const pathname = usePathname() const [isExpanded, setIsExpanded] = useState(false) const [expandedGroups, setExpandedGroups] = useState>({ foundation: true, architecture: true, features: true, infrastructure: true, bugs: true, }) // Auto-close sidebar on navigation useEffect(() => { setIsExpanded(false) }, [pathname]) const toggleGroup = (groupId: string) => { setExpandedGroups(prev => ({ ...prev, [groupId]: !prev[groupId], })) } // Group releases by their group const releasesByGroup = releases.reduce((acc, release) => { const group = release.frontmatter.group if (!acc[group]) acc[group] = [] acc[group].push(release) return acc }, {} as Record) // Check if we're on a specific release page const isReleaseDetail = pathname.startsWith('/documentatie/') && pathname !== '/documentatie' return ( <> {/* MOBILE: Overlay when expanded */} {isExpanded && (
setIsExpanded(false)} aria-hidden="true" /> )} {/* MOBILE: Collapsible sidebar from left */} {/* DESKTOP: Fixed sidebar */} ) } function StatusDot({ status }: { status: 'completed' | 'in_progress' | 'planned' }) { const colors = { completed: 'bg-teal-500', in_progress: 'bg-amber-500', planned: 'bg-slate-300', } return (
) }