MCPcopy
hub / github.com/code-hike/codehike / AllCodeDemos

Function AllCodeDemos

apps/web/components/all-code-demos.tsx:7–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import Link from "next/link"
6
7export 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}

Callers

nothing calls this directly

Calls 1

parseRootFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…