import { useRouter } from 'next/router' import Link from 'next/link' import cx from 'classnames' import type { TocItem } from '../context/ProductLandingContext' export const TableOfContents = (props: { items?: Array }) => { const router = useRouter() return (
{(props.items || []).map((obj) => { if (!obj) { return null } const { fullPath: href, title, intro } = obj const isActive = router.pathname === href return (

{title}

{intro &&

}

) })}
) }