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 { AlignItems, BorderRadius, JustifyContent, OVERFLOW_WRAP, FLEX_DIRECTION, TypographyVariant, BackgroundColor, TextColor, } 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, };