import React from 'react'; import PropTypes from 'prop-types'; import Box from '../../../ui/box'; import Typography from '../../../ui/typography'; import { AlignItems, BorderRadius, JustifyContent, OVERFLOW_WRAP, FLEX_DIRECTION, TypographyVariant, BackgroundColor, TextColor, Color, } from '../../../../helpers/constants/design-system'; import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard'; import { Icon, IconName, IconSize } from '../../../component-library'; export const Copyable = ({ text }) => { const [copied, handleCopy] = useCopyToClipboard(); return ( {text} {copied ? ( ) : ( handleCopy(text)} /> )} ); }; Copyable.propTypes = { text: PropTypes.string, };