MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handleCopy

Function handleCopy

packages/react/src/components/copy-button.tsx:22–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 const [copied, setCopied] = useState(false);
21
22 const handleCopy = () => {
23 void copyToClipboard(value).then((ok) => {
24 if (!ok) {
25 toast.error("Failed to copy to clipboard");
26 return;
27 }
28 setCopied(true);
29 onCopy?.();
30 setTimeout(() => setCopied(false), 1500);
31 });
32 };
33
34 if (label) {
35 return (

Callers

nothing calls this directly

Calls 2

copyToClipboardFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected