()
| 5 | import Link from "next/link" |
| 6 | |
| 7 | export function AllCodeDemos() { |
| 8 | const p = docs.getPages() |
| 9 | const codePages = p.filter((page) => page.slugs[0] === "code") |
| 10 | const demoPages = codePages.filter( |
| 11 | (page) => page.data.layout === "PreviewAndImplementation", |
| 12 | ) |
| 13 | |
| 14 | return demoPages.map((page) => { |
| 15 | const { title, exports } = page.data |
| 16 | const { default: MDX } = exports |
| 17 | const { demo } = parseRoot(MDX, Block.extend({ demo: Block }), { |
| 18 | components: { Demo, CodeWithNotes }, |
| 19 | }) |
| 20 | const href = `/docs/${page.slugs.join("/")}` |
| 21 | |
| 22 | return ( |
| 23 | <div key={title}> |
| 24 | <h2>{title}</h2> |
| 25 | {demo.children} |
| 26 | <p> |
| 27 | See <Link href={href}>{title} implementation</Link>. |
| 28 | </p> |
| 29 | </div> |
| 30 | ) |
| 31 | }) |
| 32 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…