MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / handleOnClick

Function handleOnClick

frontend/app/element/copybutton.tsx:19–35  ·  view source on GitHub ↗
(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

Calls 1

onClickFunction · 0.70

Tested by

no test coverage detected