MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / CopyText

Function CopyText

app/components/CopyText.tsx:10–28  ·  view source on GitHub ↗
({
  children,
  value,
  className,
  onCopied,
}: CopyTextProps)

Source from the content-addressed store, hash-verified

8};
9
10export function CopyText({
11 children,
12 value,
13 className,
14 onCopied,
15}: CopyTextProps) {
16 const onClick = useCallback(() => {
17 navigator.clipboard.writeText(value);
18 if (onCopied) {
19 onCopied();
20 }
21 }, [value]);
22
23 return (
24 <div onClick={onClick} className={`${className}`}>
25 {children}
26 </div>
27 );
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected