MCPcopy Create free account
hub / github.com/mlco2/codecarbon / handleCopy

Function handleCopy

webapp/src/components/projectTokens/projectTokenTable.tsx:66–83  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

64 };
65
66 const handleCopy = (token: string) => {
67 try {
68 const success = copy(token);
69 if (success) {
70 setIsCopied(true);
71 toast.success("Token copied to clipboard");
72 copyTimerRef.current = setTimeout(
73 () => setIsCopied(false),
74 2000,
75 );
76 } else {
77 throw new Error("Copy operation failed");
78 }
79 } catch (err) {
80 toast.error("Failed to copy token to clipboard");
81 console.error("Failed to copy token: ", err);
82 }
83 };
84
85 const resetTokenCreation = () => {
86 setCreatedToken(null);

Callers 1

ProjectTokensTableFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…