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

Function Codeblocks

apps/web/content/blog/v1.tsx:10–46  ·  view source on GitHub ↗
(props: unknown)

Source from the content-addressed store, hash-verified

8import { unknown, z } from "zod"
9
10export async function Codeblocks(props: unknown) {
11 const { code, preview, content } = parseProps(
12 props,
13 Block.extend({
14 code: CodeBlock,
15 preview: CodeBlock,
16 content: CodeBlock,
17 }),
18 )
19
20 const highlightedCode = await highlight(code, theme)
21 const highlightedContent = await highlight(content, theme)
22 const highlightedPreview = await highlight(preview, "dracula")
23
24 return (
25 <section className="flex flex-col-reverse md:flex-row gap-2 items-stretch w-full">
26 <div className="flex flex-col gap-2 items-stretch flex-1">
27 <Code codeblock={highlightedContent} className="m-0" />
28 <div
29 className="flex-1 rounded p-2 bg-[url(/dark-grid.svg)] dark:bg-[#e6edff05] bg-[#4c4f57a6] flex items-center justify-center"
30 style={{
31 backgroundPosition: "center",
32 backgroundSize: "26px",
33 }}
34 >
35 <Pre
36 code={highlightedPreview}
37 className="p-3 text-sm"
38 handlers={[tooltip]}
39 style={{ background: highlightedPreview.style.background }}
40 />
41 </div>
42 </div>
43 <Code codeblock={highlightedCode} className="m-0" />
44 </section>
45 )
46}
47
48export async function FineGrained(props: unknown) {
49 const { content, page } = parseProps(

Callers

nothing calls this directly

Calls 2

parsePropsFunction · 0.90
highlightFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…