import React from "react"; import clsx from "clsx"; import { useTOC } from "./doc-toc"; import { Disclosure, Transition } from "@headlessui/react"; import { TriangleDownIcon } from "./icons/triangle-down"; export const DocTOCMobile = () => { const { hasTOC, activeId, toc } = useTOC(); if (!hasTOC) { return null; } return (
{({ open }) => (
On this page
    {toc.map(({ id, value, level }) => { const isActive = activeId === id; return ( ); })}
)}
); };