import React from 'react'; import { useTranslation } from 'react-i18next'; import { Dialog, DialogTitle, DialogActions, DialogContent, DialogContentText, Button, Typography, Box, } from '@mui/material'; import { type Order } from '../../../models'; import currencies from '../../../../static/assets/currencies.json'; import { pn } from '../../../utils'; import { LoadingButton } from '@mui/lab'; interface ConfirmFiatReceivedDialogProps { open: boolean; loadingButton: boolean; order: Order | null; onClose: () => void; onConfirmClick: () => void; } export const ConfirmFiatReceivedDialog = ({ open, loadingButton, onClose, order, onConfirmClick, }: ConfirmFiatReceivedDialogProps): React.JSX.Element => { const { t } = useTranslation(); const currencyCode = currencies[order?.currency.toString()]; const amount = pn( parseFloat(parseFloat(order?.amount).toFixed(order?.currency === 1000 ? 8 : 4)), ); return ( {t('✅ Confirm you received {{amount}} {{currencyCode}}?', { currencyCode, amount })} {t('Confirming will finalize the trade.', { currencyCode, amount })} {t('⚠️ This action cannot be undone!')} {t('The satoshis in the escrow will be released to the buyer:')} {t('Only confirm after {{amount}} {{currencyCode}} have arrived to your account.', { currencyCode, amount, })} {t( 'If you have received the payment and do not click confirm, you risk losing your bond.', )} {t( 'Some fiat payment methods might reverse their transactions up to 80 days after they are completed. Please keep this token and your order data in case you need to use them as proof.', )} {t('Confirm')} ); }; export default ConfirmFiatReceivedDialog;