import React from 'react';
import PropTypes from 'prop-types';
import {
BannerAlert,
ButtonIcon,
ButtonPrimary,
IconName,
Text,
} from '../../component-library';
import {
AlignItems,
BorderColor,
BorderRadius,
DISPLAY,
FLEX_DIRECTION,
SEVERITIES,
TextVariant,
} from '../../../helpers/constants/design-system';
import { useI18nContext } from '../../../hooks/useI18nContext';
import Box from '../../ui/box/box';
import { useCopyToClipboard } from '../../../hooks/useCopyToClipboard';
export const AccountDetailsKey = ({ accountName, onClose, privateKey }) => {
const t = useI18nContext();
const [privateKeyCopied, handlePrivateKeyCopy] = useCopyToClipboard();
return (
<>
{t('privateKeyCopyWarning', [accountName])}
{privateKey}
handlePrivateKeyCopy(privateKey)}
iconName={privateKeyCopied ? IconName.CopySuccess : IconName.Copy}
/>
{t('privateKeyWarning')}
{t('done')}
>
);
};
AccountDetailsKey.propTypes = {
accountName: PropTypes.string.isRequired,
onClose: PropTypes.func.isRequired,
privateKey: PropTypes.string.isRequired,
};