import useTradeHistory from '../hooks/useTradeHistory' import { Table, Thead, Tbody, Tr, Th, Td } from 'react-super-responsive-table' import SideBadge from './SideBadge' // import useMangoStore from '../stores/useMangoStore' // import Loading from './Loading' const TradeHistoryTable = () => { const tradeHistory = useTradeHistory() // const connected = useMangoStore((s) => s.wallet.connected) const renderTradeDateTime = (timestamp) => { const date = new Date(timestamp) return ( <>
{date.toLocaleDateString()}
{date.toLocaleTimeString()}
) } return (
{tradeHistory && tradeHistory.length ? (
{tradeHistory.map((trade, index) => ( ))}
Market Side Size Price Liquidity Fees Approx Date/Time
{trade.marketName} {trade.size} {trade.price} {trade.liquidity} {trade.feeCost} {trade.loadTimestamp ? renderTradeDateTime(trade.loadTimestamp) : 'Recent'}
) : (
No trade history
)}
) } export default TradeHistoryTable