import KFIcon from '@/components/KFIcon';
import { Typography } from 'antd';
import styles from './index.less';

export type CopyingTextProps = {
  text: string;
};

function CopyingText({ text }: CopyingTextProps) {
  return (
    <div className={styles['copying-text']}>
      <Typography.Text ellipsis={{ tooltip: text }} className={styles['copying-text__text']}>
        {text}
      </Typography.Text>
      <KFIcon
        id="copying"
        data-clipboard-text={text}
        type="icon-fuzhi2"
        className={styles['copying-text__icon']}
        color="#606b7a"
      />
    </div>
  );
}

export default CopyingText;
