({ text }: { text: string })
| 81 | // ─── Copy button ───────────────────────────────────────────────────────────── |
| 82 | |
| 83 | function CopyButton({ text }: { text: string }) { |
| 84 | const [copied, setCopied] = useState(false); |
| 85 | |
| 86 | const handleCopy = () => { |
| 87 | navigator.clipboard.writeText(text).then(() => { |
| 88 | setCopied(true); |
| 89 | setTimeout(() => setCopied(false), 2000); |
| 90 | }); |
| 91 | }; |
| 92 | |
| 93 | return ( |
| 94 | <button |
| 95 | onClick={handleCopy} |
| 96 | className="p-1 rounded text-surface-400 hover:text-surface-200 hover:bg-surface-700 transition-colors" |
| 97 | title="Copy" |
| 98 | > |
| 99 | {copied ? <Check className="w-3.5 h-3.5 text-green-400" /> : <Copy className="w-3.5 h-3.5" />} |
| 100 | </button> |
| 101 | ); |
| 102 | } |
| 103 | |
| 104 | // ─── Unified diff view ─────────────────────────────────────────────────────── |
| 105 |
nothing calls this directly
no outgoing calls
no test coverage detected