import React from 'react'; import { TableOfContents as TOCType } from '@/lib/toc'; interface TableOfContentsProps { toc: TOCType; } function renderTOCItems(items: any[], level = 0) { if (!items || items.length === 0) return null; return ( ); } export default function TableOfContents({ toc }: TableOfContentsProps) { if (!toc.items || toc.items.length === 0) { return null; } return (

On this Page

{renderTOCItems(toc.items)}
); }