MCPcopy
hub / github.com/stackblitz/bolt.new / copyToClipboard

Function copyToClipboard

app/components/chat/CodeBlock.tsx:23–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 const [copied, setCopied] = useState(false);
22
23 const copyToClipboard = () => {
24 if (copied) {
25 return;
26 }
27
28 navigator.clipboard.writeText(code);
29
30 setCopied(true);
31
32 setTimeout(() => {
33 setCopied(false);
34 }, 2000);
35 };
36
37 useEffect(() => {
38 if (language && !isSpecialLang(language) && !(language in bundledLanguages)) {

Callers 1

CodeBlock.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected