MCPcopy Create free account
hub / github.com/benjitaylor/agentation / CodeBlock

Function CodeBlock

package/example/src/app/components/CodeBlock.tsx:206–236  ·  view source on GitHub ↗
({
  code,
  language = "tsx",
  copyable = false,
}: {
  code: string;
  language?: string;
  copyable?: boolean;
})

Source from the content-addressed store, hash-verified

204}
205
206export function CodeBlock({
207 code,
208 language = "tsx",
209 copyable = false,
210}: {
211 code: string;
212 language?: string;
213 copyable?: boolean;
214}) {
215 return (
216 <div style={{ position: "relative" }}>
217 <Highlight theme={themes.github} code={code.trim()} language={language}>
218 {({ style, tokens, getLineProps, getTokenProps }) => (
219 <pre
220 className="code-block"
221 style={{ ...style, background: "transparent" }}
222 >
223 {tokens.map((line, i) => (
224 <div key={i} {...getLineProps({ line })}>
225 {line.map((token, key) => (
226 <span key={key} {...getTokenProps({ token })} />
227 ))}
228 </div>
229 ))}
230 </pre>
231 )}
232 </Highlight>
233 {copyable && <CopyButton text={code.trim()} />}
234 </div>
235 );
236}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…