MCPcopy Create free account
hub / github.com/codeaashu/claude-code / CopyButton

Function CopyButton

web/components/tools/DiffView.tsx:83–102  ·  view source on GitHub ↗
({ text }: { text: string })

Source from the content-addressed store, hash-verified

81// ─── Copy button ─────────────────────────────────────────────────────────────
82
83function 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected