MCPcopy Index your code
hub / github.com/intentui/intentui / handleCopy

Function handleCopy

src/components/code/editor-text.tsx:29–38  ·  view source on GitHub ↗
(key: string, value: string | null)

Source from the content-addressed store, hash-verified

27 const [rawSourceCode, setRawSourceCode] = useState<Record<string, string | null>>({})
28
29 const handleCopy = async (key: string, value: string | null) => {
30 if (value) {
31 const didCopy = await copy(value)
32 if (!didCopy) return
33 setCopiedStates((prev) => ({ ...prev, [key]: true }))
34 setTimeout(() => {
35 setCopiedStates((prev) => ({ ...prev, [key]: false }))
36 }, 2000)
37 }
38 }
39
40 useEffect(() => {
41 const fetchRegistryData = async () => {

Callers 1

EditorTextFunction · 0.70

Calls 1

copyFunction · 0.85

Tested by

no test coverage detected