import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Avatar, Badge, ToggleButton, ToggleButtonGroup, List, ListItem, ListItemText, ListItemIcon, Grid, Tooltip, IconButton, Accordion, AccordionSummary, AccordionDetails, Typography, } from "@mui/material" import { pn } from "../utils/prettyNumbers"; import { saveAsJson } from "../utils/saveFile"; // Icons import FlagWithProps from "./FlagWithProps"; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import DownloadIcon from '@mui/icons-material/Download'; import AccountBalanceIcon from '@mui/icons-material/AccountBalance'; import RouteIcon from '@mui/icons-material/Route'; import AccountBoxIcon from '@mui/icons-material/AccountBox'; import LockOpenIcon from '@mui/icons-material/LockOpen'; import LinkIcon from '@mui/icons-material/Link'; import { RoboSatsNoTextIcon , SendReceiveIcon , BitcoinIcon} from "./Icons"; interface Item { id: string; name: string; } type Props = { isMaker: boolean; makerNick: string; takerNick: string; currencyCode: string; makerSummary: Record; takerSummary: Record; platformSummary: Record; orderId: number; } const TradeSummary = ({ isMaker, makerNick, takerNick, currencyCode, makerSummary, takerSummary, platformSummary, orderId, }: Props): JSX.Element => { const { t } = useTranslation(); const [buttonValue, setButtonValue] = useState(isMaker ? 0 : 2); var userSummary = buttonValue == 0 ? makerSummary : takerSummary; return ( }> {t("Trade Summary")}
setButtonValue(0)}>   {t("Maker")} setButtonValue(1)}> setButtonValue(2)}> {t("Taker")}   saveAsJson(`order${orderId}-summary.json`, {'order_id':orderId,'currency':currencyCode,'maker':makerSummary,'taker':takerSummary,'platform':platformSummary})} >
{/* Maker/Taker Summary */}
{userSummary.is_buyer ? : }
}>
{userSummary.is_swap ? : null} {t("Unlocked")}}/> {/* Platform Summary */}
); }; export default TradeSummary;