(props: unknown)
| 8 | import { unknown, z } from "zod" |
| 9 | |
| 10 | export 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 | |
| 48 | export async function FineGrained(props: unknown) { |
| 49 | const { content, page } = parseProps( |
nothing calls this directly
no test coverage detected
searching dependent graphs…