(token: string)
| 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); |
no outgoing calls
no test coverage detected
searching dependent graphs…