Feat: Add nav link to live dashboard

This commit is contained in:
2026-03-16 11:31:26 -07:00
parent 32e1fa31f7
commit c1bc4750bc

View File

@@ -86,6 +86,9 @@ export default function PaperDashboard() {
<span className="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded-full font-medium">PAPER</span> <span className="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded-full font-medium">PAPER</span>
</div> </div>
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<a href="/dash" className="text-[10px] px-2 py-1 rounded bg-gray-900 text-green-400 border border-gray-700 hover:bg-gray-800 transition-colors font-bold">
💰 Live
</a>
<button <button
onClick={handleReset} onClick={handleReset}
disabled={resetting} disabled={resetting}
@@ -298,7 +301,6 @@ function AllStrategiesOverview({ paperByStrategy, strategies }) {
})); }));
if (!entries.length) return null; if (!entries.length) return null;
entries.sort((a, b) => b.stats.totalPnL - a.stats.totalPnL); entries.sort((a, b) => b.stats.totalPnL - a.stats.totalPnL);
return ( return (
@@ -339,10 +341,8 @@ function StatBox({ label, value, color }) {
} }
function TradeRow({ trade, isOpen }) { function TradeRow({ trade, isOpen }) {
// Fix: Check side vs result for actual win condition, not strictly PNL > 0
const won = trade.result && trade.side.toLowerCase() === trade.result.toLowerCase(); const won = trade.result && trade.side.toLowerCase() === trade.result.toLowerCase();
const isNeutral = trade.result === 'cancelled' || trade.result === 'expired'; const isNeutral = trade.result === 'cancelled' || trade.result === 'expired';
const pnlColor = trade.pnl == null ? 'text-gray-400' : trade.pnl > 0 ? 'text-green-600' : trade.pnl < 0 ? 'text-red-600' : 'text-gray-600'; const pnlColor = trade.pnl == null ? 'text-gray-400' : trade.pnl > 0 ? 'text-green-600' : trade.pnl < 0 ? 'text-red-600' : 'text-gray-600';
return ( return (