import React, { Component } from "react"; import { IconButton, Paper, Rating, Button, Grid, Typography, TextField, List, ListItem, ListItemText, Divider, ListItemIcon, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle} from "@mui/material" import QRCode from "react-qr-code"; import Countdown 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'; 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) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } export default class TradeBox extends Component { constructor(props) { super(props); this.state = { openConfirmFiatReceived: false, openConfirmDispute: false, badInvoice: false, badStatement: false, qrscanner: false, } } Sound = ({soundFileName}) => ( // Four filenames: "locked-invoice", "taker-found", "open-chat", "sucessful"