import { Box, Icon, Text } from '@tlon/indigo-react'; import cn from 'classnames'; import useCopiable from '../../lib/useCopiable'; import withFadeable from './withFadeable'; interface MasterKeyCopyProps { text: string; className?: string; } const MasterKeyCopy = ({ text, className }: MasterKeyCopyProps) => { const [doCopy, didCopy] = useCopiable(text); const { color, label, icon } = didCopy ? { color: 'rgb(70,156,106)', label: 'Copied', icon: 'Checkmark' } : { color: 'rgb(89,167,248)', label: 'Copy', icon: 'Copy' }; return ( doCopy()}> {label} ); }; export default MasterKeyCopy; export const FadeableMasterKeyCopy = withFadeable(MasterKeyCopy);