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

Function CopyButton

web/components/tools/ToolBash.tsx:22–42  ·  view source on GitHub ↗
({ text }: { text: string })

Source from the content-addressed store, hash-verified

20}
21
22function CopyButton({ text }: { text: string }) {
23 const [copied, setCopied] = useState(false);
24 return (
25 <button
26 onClick={() => {
27 navigator.clipboard.writeText(text).then(() => {
28 setCopied(true);
29 setTimeout(() => setCopied(false), 2000);
30 });
31 }}
32 className="p-1 rounded text-surface-400 hover:text-surface-200 hover:bg-surface-700 transition-colors"
33 title="Copy command"
34 >
35 {copied ? (
36 <Check className="w-3.5 h-3.5 text-green-400" />
37 ) : (
38 <Copy className="w-3.5 h-3.5" />
39 )}
40 </button>
41 );
42}
43
44// Parse exit code from result — bash tool often appends it
45function parseExitCode(result: string): number | null {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected