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

Function BlocksDemo

apps/web/components/code/blocks-demo.tsx:16–50  ·  view source on GitHub ↗
(props: unknown)

Source from the content-addressed store, hash-verified

14import { HighCode } from "../code"
15
16export async function BlocksDemo(props: unknown) {
17 const { content, component, result, caption } = parseProps(
18 props,
19 Block.extend({
20 caption: z.string().optional(),
21 content: CodeBlock,
22 component: CodeBlock,
23 result: CodeBlock,
24 }),
25 )
26
27 const resultChildren = <CalloutCode code={result} />
28 return (
29 <figure className="ruler-group m-0">
30 <div className="flex gap-2 items-stretch w-full flex-wrap">
31 <div className="min-w-72 flex-1 ">
32 <CodeWithNotes code={content} />
33 </div>
34 <div className="min-w-72 flex-1 min-h-full">
35 <CodeWithNotes
36 code={component}
37 notes={{
38 result: { children: resultChildren },
39 }}
40 />
41 </div>
42 </div>
43 {caption && (
44 <figcaption className="text-sm pt-2 text-center opacity-70">
45 {caption}
46 </figcaption>
47 )}
48 </figure>
49 )
50}
51
52export async function CodeWithNotes({
53 code,

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…