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, } from '../../../../helpers/constants/design-system'; import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard'; import { Icon, ICON_NAMES, ICON_SIZES } from '../../../component-library'; export const Copyable = ({ text }) => { const [copied, handleCopy] = useCopyToClipboard(); return ( {text} {copied ? ( ) : ( handleCopy(text)} /> )} ); }; Copyable.propTypes = { text: PropTypes.string, };