MCPcopy Create free account
hub / github.com/caesarHQ/textSQL / handleCopy

Function handleCopy

client/censusGPT/src/components/results/sqlDisplay.js:31–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30 const CopySqlToClipboardButton = ({ text }) => {
31 const handleCopy = async () => {
32 if ('clipboard' in navigator) {
33 setCopied(true)
34 setTimeout(() => setCopied(false), 1000)
35 return await navigator.clipboard.writeText(text)
36 } else {
37 setCopied(true)
38 setTimeout(() => setCopied(false), 1000)
39 return document.execCommand('copy', true, text)
40 }
41 }
42
43 return (
44 <button

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected