- {positions.map((pos) => {
- const pnl =
- pos.positionType === 'LONG'
- ? (pos.hashtag.currentPrice - pos.avgBuyPrice) * pos.shares
- : (pos.avgBuyPrice - pos.hashtag.currentPrice) * pos.shares
- const costBasis = pos.avgBuyPrice * pos.shares
- const currentValue = pos.hashtag.currentPrice * pos.shares
- const pnlPct = costBasis > 0 ? (pnl / costBasis) * 100 : 0
- const sparkPrices = pos.hashtag.priceHistory.map((h) => h.price)
-
- return (
-
- {/* Hashtag + type badge (+ sparkline on desktop) */}
-
-
-
-
-
-
- #{pos.hashtag.displayTag}
-
-
- {pos.positionType}
-
-
+ {positions.map((pos) => (
+
+ {/* Hashtag + type badge (+ sparkline on desktop) */}
+
+
+
-
-
{formatNumber(pos.shares)}
-
{formatCurrency(pos.avgBuyPrice)}
-
{formatCurrency(pos.hashtag.currentPrice)}
-
{formatCurrency(costBasis)}
-
{formatCurrency(currentValue)}
-
-
-
{formatPnl(pnl)}
-
- {pnlPct >= 0 ? '+' : ''}
- {pnlPct.toFixed(1)}%
-
+
+
+ #{pos.hashtag.displayTag}
+
+
+ {pos.positionType}
+
- )
- })}
+
+
{formatNumber(pos.shares)}
+
{formatCurrency(pos.avgBuyPrice)}
+
{formatCurrency(pos.hashtag.currentPrice)}
+
{formatCurrency(pos.costBasis)}
+
{formatCurrency(pos.currentValue)}
+
+
+
{formatPnl(pos.pnl)}
+
+ {pos.pnlPct >= 0 ? '+' : ''}
+ {pos.pnlPct.toFixed(1)}%
+
+
+
+ ))}
)}