MCPcopy Create free account
hub / github.com/pinterest/gestalt / copyCode

Function copyCode

docs/docs-components/ExampleCode.tsx:13–20  ·  view source on GitHub ↗
({ code }: { code: string })

Source from the content-addressed store, hash-verified

11const CODE_EXAMPLE_HEIGHT = 162;
12
13async function copyCode({ code }: { code: string }) {
14 try {
15 await clipboardCopy(code);
16 } catch (error: any) {
17 // eslint-disable-next-line no-console
18 console.error(error);
19 }
20}
21
22type Props = {
23 code: string;

Callers 1

ExampleCodeFunction · 0.70

Calls 1

clipboardCopyFunction · 0.85

Tested by

no test coverage detected