import { ArrowSmDownIcon } from '@heroicons/react/solid' import useTradeHistory from '../hooks/useTradeHistory' import Link from 'next/link' import { useRouter } from 'next/router' import { Table, Thead, Tbody, Tr, Th, Td } from 'react-super-responsive-table' import SideBadge from './SideBadge' import { LinkButton } from './Button' import { useSortableData } from '../hooks/useSortableData' import useMangoStore from '../stores/useMangoStore' const TradeHistoryTable = () => { const { asPath } = useRouter() const tradeHistory = useTradeHistory() const { items, requestSort, sortConfig } = useSortableData(tradeHistory) const marketConfig = useMangoStore((s) => s.selectedMarket.config) const renderTradeDateTime = (timestamp) => { const date = new Date(timestamp) return ( <>
|
|
|
|
|
|
|
|
---|---|---|---|---|---|---|---|
{trade.marketName}
|
|
{trade.size} | {trade.price} | ${(trade.price * trade.size).toFixed(2)} | {trade.liquidity} | {trade.feeCost} | {trade.loadTimestamp ? renderTradeDateTime(trade.loadTimestamp) : 'Recent'} |