import React, { Component } from 'react'; import { withTranslation, Trans } from 'react-i18next'; import { Alert, AlertTitle, ToggleButtonGroup, ToggleButton, IconButton, Link, Paper, Rating, Button, Tooltip, CircularProgress, Grid, Typography, TextField, List, ListItem, ListItemText, Divider, ListItemIcon, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, } from '@mui/material'; import { LoadingButton } from '@mui/lab'; import QRCode from 'react-qr-code'; import Countdown, { zeroPad } from 'react-countdown'; import EncryptedChat from './EncryptedChat'; import TradeSummary from './TradeSummary'; import MediaQuery from 'react-responsive'; import { systemClient } from '../../services/System'; import { apiClient } from '../../services/api'; // Icons import PercentIcon from '@mui/icons-material/Percent'; import BookIcon from '@mui/icons-material/Book'; import LockIcon from '@mui/icons-material/Lock'; import LockOpenIcon from '@mui/icons-material/LockOpen'; import BalanceIcon from '@mui/icons-material/Balance'; import ContentCopy from '@mui/icons-material/ContentCopy'; import PauseCircleIcon from '@mui/icons-material/PauseCircle'; import PlayCircleIcon from '@mui/icons-material/PlayCircle'; import BoltIcon from '@mui/icons-material/Bolt'; import LinkIcon from '@mui/icons-material/Link'; import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'; import FavoriteIcon from '@mui/icons-material/Favorite'; import RocketLaunchIcon from '@mui/icons-material/RocketLaunch'; import RefreshIcon from '@mui/icons-material/Refresh'; import { NewTabIcon } from '../Icons'; import { pn } from '../../utils/prettyNumbers'; class TradeBox extends Component { invoice_escrow_duration = 3; constructor(props) { super(props); this.state = { openConfirmFiatReceived: false, loadingButtonFiatSent: false, loadingButtonFiatReceived: false, loadingSubmitInvoice: false, loadingSubmitAddress: false, openConfirmDispute: false, receiveTab: 0, address: '', miningFee: 1.05, badInvoice: false, badAddress: false, badStatement: false, }; } Sound = (soundFileName) => ( // Four filenames: "locked-invoice", "taker-found", "open-chat", "successful"