import { Position } from '../types'; import { cn } from '../lib/utils'; interface PositionsTableProps { positions: Position[]; priceFlash: { [key: string]: 'up' | 'down' | null }; className?: string; } export const PositionsTable = ({ positions, priceFlash, className }: PositionsTableProps) => { return (
| Symbol | Type | Leverage | Entry Price | Mark Price | P&L ($) | P&L (%) | Size |
|---|---|---|---|---|---|---|---|
| {position.symbol} | {position.type} | {position.leverage} | ${position.entryPrice.toLocaleString()} | ${position.markPrice.toLocaleString()} | {isPositive ? '+' : ''}${position.pnlDollars.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })} | {isPositive ? '+' : ''}{position.pnlPercent.toFixed(2)}% | {position.size} |