import { Link, useParams } from 'react-router-dom'; import { groupByPart, CHAPTERS } from '../lib/chapters.ts'; import { isChapterDone } from '../lib/progress.ts'; interface Props { open: boolean; onClose: () => void; } const PARTS = groupByPart(CHAPTERS); export default function TOCSidebar({ open, onClose }: Props) { const { id: activeId } = useParams<{ id: string }>(); return ( <> {/* Backdrop (mobile) */} {open && (
)} > ); }