MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / BlockCode

Function BlockCode

apps/web/ui/Message/BlockCode/index.tsx:28–54  ·  view source on GitHub ↗
({ value, language, placeholder }: Props)

Source from the content-addressed store, hash-verified

26}
27
28export default function BlockCode({ value, language, placeholder }: Props) {
29 const input = normalize(value, language);
30 const content = decodeHTML(input);
31 return (
32 <>
33 <div className={styles.label}>
34 <span>{language}</span>
35 <span
36 className={styles.right}
37 onClick={() => {
38 copyToClipboard(value);
39 Toast.success('Copied code to clipboard');
40 }}
41 >
42 <FiClipboard /> Copy code
43 </span>
44 </div>
45 <Code
46 className={styles.code}
47 block
48 content={isFormattable(content) ? formatCode(content) : content}
49 language={language}
50 highlight={!placeholder && isHighlighted(value)}
51 />
52 </>
53 );
54}

Callers

nothing calls this directly

Calls 7

decodeHTMLFunction · 0.90
copyToClipboardFunction · 0.90
isFormattableFunction · 0.90
formatCodeFunction · 0.90
isHighlightedFunction · 0.90
successMethod · 0.80
normalizeFunction · 0.70

Tested by

no test coverage detected