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

Function LayoutExample

apps/web/app/docs/[[...slug]]/layout-example.tsx:15–50  ·  view source on GitHub ↗
({ MDX }: { MDX: any })

Source from the content-addressed store, hash-verified

13})
14
15export function LayoutExample({ MDX }: { MDX: any }) {
16 const content = parseRoot(MDX, ContentSchema)
17 const { intro, mdx, preview, code } = content
18
19 return (
20 <>
21 {intro.children}
22 <Tabs items={["Preview", "MDX", "Code"]}>
23 <Tab
24 value="Preview"
25 className="bg-blue-500/30 mt-0 p-6 bg-[url(/dark-grid.svg)]"
26 >
27 <div
28 className={`border border-primary/50 bg-zinc-950 rounded overflow-hidden ${preview.title}`}
29 >
30 {preview.children}
31 </div>
32 </Tab>
33 <Tab value="MDX">
34 <div className="border border-zinc-300/20 rounded mb-8 bg-zinc-900">
35 <div className="items-center bg-zinc-800 p-2 pl-4 text-xs flex text-zinc-100">
36 <span>content.mdx</span>
37 <CopyButton className="ml-auto" text={mdx.value} />
38 </div>
39 <MDXCode data={mdx} />
40 </div>
41 </Tab>
42 <Tab value="Code">
43 {code.map((codeblock, i) => (
44 <Code key={i} codeblock={codeblock} />
45 ))}
46 </Tab>
47 </Tabs>
48 </>
49 )
50}
51
52async function MDXCode({ data }: { data: RawCode }) {
53 const info = await highlight(data, "github-dark")

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…