/** * T038, T048-T049: Table of Contents component * Displays hierarchical list of document headings with smooth navigation */ import { ScrollArea } from '@/components/ui/scroll-area'; import { cn } from '@/lib/utils'; import type { Heading } from '@/hooks/useTableOfContents'; interface TableOfContentsProps { headings: Heading[]; onHeadingClick: (id: string) => void; } export function TableOfContents({ headings, onHeadingClick }: TableOfContentsProps) { // T049: Show empty state message when no headings if (headings.length === 0) { return (

No headings found

Add H1, H2, or H3 headings to your note

); } // T048: Calculate indentation based on heading level const getIndentation = (level: number) => { // H1 = 0px, H2 = 12px, H3 = 24px return (level - 1) * 12; }; return (

Table of Contents

); }