import type { PendingOrder } from "@/lib/mt5"; const ORDER_LABEL: Record = { 2: { label: "BUY LIMIT", bull: true }, 3: { label: "SELL LIMIT", bull: false }, 4: { label: "BUY STOP", bull: true }, 5: { label: "SELL STOP", bull: false }, }; export default function PendingOrdersTable({ orders }: { orders: PendingOrder[] }) { return ( {["Symbol", "Type", "Vol", "Entry", "Current", "SL", "TP", "Comment"].map(h => ( ))} {orders.map((o) => { const kind = ORDER_LABEL[o.type] ?? { label: `TYPE ${o.type}`, bull: true }; return ( ); })}
{h}
{o.symbol} {kind.label} {o.volume_current} {o.price_open.toFixed(2)} {o.price_current.toFixed(2)} {o.sl > 0 ? o.sl.toFixed(2) : "—"} {o.tp > 0 ? o.tp.toFixed(2) : "—"} {o.comment || "—"}
); }