import type { Trade } from "../types"; import { Card } from "./Card"; import { btc, clsx, timeOf, usd } from "../format"; interface Props { trades: Trade[]; } export function TradeLog({ trades }: Props): JSX.Element { return (
{trades.length === 0 && ( )} {trades.map((t) => ( ))}
Time Route Vol Buy Sell Fees Net P&L
No trades executed yet.
{timeOf(t.ts)} {t.buyExchange} {t.sellExchange} {t.partial && partial} {btc(t.volumeBtc)} {usd(t.execBuyVwap)} {usd(t.execSellVwap)} {usd(t.feeBuy + t.feeSell)} = 0 ? "text-profit" : "text-loss")}> {t.netProfit >= 0 ? "+" : ""} {usd(t.netProfit)}
); }