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

Function ExampleTabs

apps/web/ui/example-tabs.tsx:15–43  ·  view source on GitHub ↗
({ hike }: any)

Source from the content-addressed store, hash-verified

13type TabsContent = z.infer<typeof TabsSchema>
14
15export function ExampleTabs({ hike }: any) {
16 const content = parseProps(hike, TabsSchema)
17 const mdx = content.code.filter((code: any) => code.lang === "mdx")[0]
18 const code = content.code.filter((code: any) => code.lang !== "mdx")
19 const preview = content.preview
20
21 return (
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 ${preview.title}`}
29 >
30 {preview.children}
31 </div>
32 </Tab>
33 <Tab value="MDX">
34 <MDX codeblock={mdx} />
35 </Tab>
36 <Tab value="Code">
37 {code.map((codeblock: any, i: number) => (
38 <Code key={i} codeblocks={[codeblock]} />
39 ))}
40 </Tab>
41 </Tabs>
42 )
43}
44
45async function MDX({ codeblock }: { codeblock: TabsContent["code"][0] }) {
46 const info = await highlight(codeblock, "github-dark")

Callers

nothing calls this directly

Calls 1

parsePropsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…