MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / handleCopy

Function handleCopy

website/src/components/CookbookSection.tsx:168–177  ·  view source on GitHub ↗
(e: React.MouseEvent, text: string)

Source from the content-addressed store, hash-verified

166 const [copied, setCopied] = useState(false);
167
168 const handleCopy = (e: React.MouseEvent, text: string) => {
169 e.stopPropagation(); // prevent collapsing when copying
170 navigator.clipboard.writeText(text);
171 setCopied(true);
172 toast({
173 title: "Copied to clipboard!",
174 description: "The code snippet has been copied to your clipboard.",
175 });
176 setTimeout(() => setCopied(false), 2000);
177 };
178
179 return (
180 <div>

Callers 1

ExampleCardFunction · 0.70

Calls 1

toastFunction · 0.85

Tested by

no test coverage detected