Function
handleOnClick
(e: React.MouseEvent<HTMLButtonElement>)
Source from the content-addressed store, hash-verified
| 17 | const timeoutRef = useRef<NodeJS.Timeout | null>(null); |
| 18 | |
| 19 | const handleOnClick = (e: React.MouseEvent<HTMLButtonElement>) => { |
| 20 | if (isCopied) { |
| 21 | return; |
| 22 | } |
| 23 | setIsCopied(true); |
| 24 | if (timeoutRef.current) { |
| 25 | clearTimeout(timeoutRef.current); |
| 26 | } |
| 27 | timeoutRef.current = setTimeout(() => { |
| 28 | setIsCopied(false); |
| 29 | timeoutRef.current = null; |
| 30 | }, 2000); |
| 31 | |
| 32 | if (onClick) { |
| 33 | onClick(e); |
| 34 | } |
| 35 | }; |
| 36 | |
| 37 | useEffect(() => { |
| 38 | return () => { |
Callers
nothing calls this directly
Tested by
no test coverage detected