import React from 'react'; import PropTypes from 'prop-types'; import Box from '../../../ui/box'; import IconCopied from '../../../ui/icon/icon-copied'; import IconCopy from '../../../ui/icon/icon-copy'; import Typography from '../../../ui/typography'; import { ALIGN_ITEMS, BORDER_RADIUS, COLORS, JUSTIFY_CONTENT, OVERFLOW_WRAP, FLEX_DIRECTION, TYPOGRAPHY, } from '../../../../helpers/constants/design-system'; import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard'; export const Copyable = ({ text }) => { const [copied, handleCopy] = useCopyToClipboard(); return ( {text} {copied ? ( ) : ( handleCopy(text)} size={18} /> )} ); }; Copyable.propTypes = { text: PropTypes.string, };