import { useActiveHeading } from "@/hooks/useActiveHeading"; import type { TPostTOCItem } from "@/types/docs.type"; import Link from "next/link"; import { twMerge } from "tailwind-merge"; export const TOC = (props: { data: TPostTOCItem[] }) => { const activeId = useActiveHeading(props.data.map((item) => `#${item.anchorId}`)); return (
{"TABLE OF CONTENTS"}
{props.data?.map((item) => (
{`${item.title}`}
))}
); };