({
children,
value,
className,
onCopied,
}: CopyTextProps)
| 8 | }; |
| 9 | |
| 10 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected