()
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected