({
text,
onCopy,
multiline,
codeClassName,
}: CopyableCodeBlockProps)
| 16 | } |
| 17 | |
| 18 | export 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 | ); |
nothing calls this directly
no outgoing calls
no test coverage detected