export const layout = "./base.tsx"; export default function({ children, toc }) { return ( <> { toc.length > 0 && Table of Contents {toc.map(item => ( {item.text} {item.children.length > 0 && {item.children.map(child => ( {child.text} ))} } ))} } { children } > ); }