import React, { Component } from "react"; import { IconButton, Box, Link, Paper, Rating, Button, Tooltip, CircularProgress, Grid, Typography, TextField, List, ListItem, ListItemText, Divider, ListItemIcon, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle} from "@mui/material" import QRCode from "react-qr-code"; import Countdown, { zeroPad} from 'react-countdown'; import Chat from "./Chat" import MediaQuery from 'react-responsive' import QrReader from 'react-qr-reader' // Icons import PercentIcon from '@mui/icons-material/Percent'; import BookIcon from '@mui/icons-material/Book'; import QrCodeScannerIcon from '@mui/icons-material/QrCodeScanner'; import SendIcon from '@mui/icons-material/Send'; 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"; function getCookie(name) { let cookieValue = null; if (document.cookie && document.cookie !== '') { const cookies = document.cookie.split(';'); for (let i = 0; i < cookies.length; i++) { const cookie = cookies[i].trim(); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) === (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } const csrftoken = getCookie('csrftoken'); // pretty numbers function pn(x) { var parts = x.toString().split("."); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); return parts.join("."); } export default class TradeBox extends Component { constructor(props) { super(props); this.state = { openConfirmFiatReceived: false, openConfirmDispute: false, openEnableTelegram: false, badInvoice: false, badStatement: false, qrscanner: false, } } Sound = ({soundFileName}) => ( // Four filenames: "locked-invoice", "taker-found", "open-chat", "successful"