MCPcopy Create free account
hub / github.com/dailydotdev/apps / CopyableCodeBlock

Function CopyableCodeBlock

packages/webapp/components/CopyableCodeBlock.tsx:18–42  ·  view source on GitHub ↗
({
  text,
  onCopy,
  multiline,
  codeClassName,
}: CopyableCodeBlockProps)

Source from the content-addressed store, hash-verified

16}
17
18export const CopyableCodeBlock = ({
19 text,
20 onCopy,
21 multiline,
22 codeClassName,
23}: CopyableCodeBlockProps): ReactElement => (
24 <div className="flex items-start gap-2 rounded-12 bg-surface-float p-3">
25 <code
26 className={classNames(
27 'min-w-0 flex-1 break-words text-text-tertiary',
28 multiline && 'whitespace-pre-wrap',
29 codeClassName,
30 )}
31 >
32 {text}
33 </code>
34 <Button
35 variant={ButtonVariant.Tertiary}
36 size={ButtonSize.Small}
37 icon={<CopyIcon />}
38 onClick={onCopy}
39 className="shrink-0"
40 />
41 </div>
42);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected