import { ReactNode, Fragment, useState, useContext } from "react"; import { type Toc } from "@stefanprobst/rehype-extract-toc"; import { useLocation } from "react-router-dom"; import { HeadingContext } from "./HeadingContext"; function RecursivelyToc({ toc }: { toc: Toc }) { const location = useLocation(); const [activeHeadings] = useContext(HeadingContext); return (