MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / copyToClipboard

Function copyToClipboard

app/src/utils/useCopyToClipboard.ts:6–21  ·  view source on GitHub ↗
(text?: string)

Source from the content-addressed store, hash-verified

4 const toast = useToast();
5
6 const copyToClipboard = async (text?: string) => {
7 try {
8 await navigator.clipboard.writeText(text as string);
9 toast({
10 title: "Copied to clipboard",
11 status: "success",
12 duration: 2000,
13 });
14 } catch (err) {
15 toast({
16 title: "Failed to copy to clipboard",
17 status: "error",
18 duration: 2000,
19 });
20 }
21 };
22
23 return copyToClipboard;
24};

Callers 4

FormattedJsonFunction · 0.85
CopiableCodeTabsFunction · 0.85
ExtendableAreaFunction · 0.85
NodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected