({ copied, copy }: { copied: boolean; copy: () => void })
| 76 | } |
| 77 | |
| 78 | function CopyButton({ copied, copy }: { copied: boolean; copy: () => void }) { |
| 79 | return ( |
| 80 | <button |
| 81 | onClick={copy} |
| 82 | className={`flex items-center gap-1.5 px-2 py-1 rounded text-xs font-mono transition-all duration-150 |
| 83 | ${copied |
| 84 | ? 'text-green-600 dark:text-[#28c840]' |
| 85 | : 'text-[#bbb] dark:text-[#444] hover:text-[#555] dark:hover:text-[#aaa]' |
| 86 | }`} |
| 87 | aria-label={copied ? 'Copied' : 'Copy'} |
| 88 | > |
| 89 | {copied ? <CheckIcon /> : <ClipboardIcon />} |
| 90 | <span>{copied ? 'copied' : 'copy'}</span> |
| 91 | </button> |
| 92 | ) |
| 93 | } |
| 94 | |
| 95 | function TerminalBlock({ code, label, className = '' }: { code: string; label?: string; className?: string }) { |
| 96 | const { copied, copy } = useCopy(code) |
nothing calls this directly
no outgoing calls
no test coverage detected