/** * Table of Contents for v2 technique pages with nested sections. * * Renders a nested list of anchor links matching the H2/H3 section structure. * Uses slugified headings as IDs for scroll targeting. */ import type { BodySectionV2 } from "../api/public-client"; export function slugify(text: string): string { return text .toLowerCase() .replace(/[^a-z0-9]+/g, "-") .replace(/^-|-$/g, ""); } interface TableOfContentsProps { sections: BodySectionV2[]; } export default function TableOfContents({ sections }: TableOfContentsProps) { if (sections.length === 0) return null; return ( ); }