MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / handleCopy

Function handleCopy

cli/src/components/copy-button.tsx:137–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135 const { setTimeout } = useTimeout()
136
137 const handleCopy = async () => {
138 try {
139 await copyTextToClipboard(textToCopy, {
140 suppressGlobalMessage: true,
141 })
142 const newState = copyButtonHandlers.handleCopy()
143 setIsCopied(newState.isCopied)
144 setIsHovered(newState.isHovered)
145 setTimeout('reset-copied', () => setIsCopied(false), COPIED_RESET_DELAY_MS)
146 } catch (_error) {
147 // Error is already logged and displayed by copyTextToClipboard
148 }
149 }
150
151 const handleMouseOver = () => {
152 const shouldHover = copyButtonHandlers.handleMouseOver(isCopied)

Callers

nothing calls this directly

Calls 2

copyTextToClipboardFunction · 0.90
setTimeoutFunction · 0.85

Tested by

no test coverage detected