diff --git a/src/components/landing/PortfolioSection.tsx b/src/components/landing/PortfolioSection.tsx index 9e898126..ff5acde9 100644 --- a/src/components/landing/PortfolioSection.tsx +++ b/src/components/landing/PortfolioSection.tsx @@ -573,8 +573,14 @@ export default function PortfolioSection() { const showReconnectBroker = isConnected && (showSessionExpired || brokerAuthExpired); const normalizedStrategyStatus = - strategyStatus === "RUNNING" ? "RUNNING" : "STOPPED"; - const isStrategyRunning = normalizedStrategyStatus === "RUNNING"; + strategyStatus === "RUNNING" + ? "RUNNING" + : strategyStatus === "WAITING" + ? "WAITING" + : "STOPPED"; + const isStrategyActive = + normalizedStrategyStatus === "RUNNING" || + normalizedStrategyStatus === "WAITING"; const heartbeatAgeSec = engineStatus?.last_heartbeat_ts ? (Date.now() - new Date(engineStatus.last_heartbeat_ts).getTime()) / 1000 @@ -601,6 +607,26 @@ export default function PortfolioSection() { : liveness === "DEAD" ? "border-red-500/50 bg-red-500/15 text-red-300" : "border-slate-400/40 bg-slate-400/15 text-slate-200"; + const livenessBadgeLabel = + liveness === "ACTIVE" + ? "Engine active" + : liveness === "STALLED" + ? "Engine stalled" + : liveness === "DEAD" + ? "Engine dead" + : "Engine stopped"; + const strategyBadgeClass = + normalizedStrategyStatus === "RUNNING" + ? "border-emerald-500/50 bg-emerald-500/10 text-emerald-400" + : normalizedStrategyStatus === "WAITING" + ? "border-amber-400/50 bg-amber-400/10 text-amber-300" + : "border-red-500/40 bg-red-500/10 text-red-400"; + const strategyBadgeLabel = + normalizedStrategyStatus === "RUNNING" + ? "Strategy running" + : normalizedStrategyStatus === "WAITING" + ? "Strategy waiting" + : "Strategy stopped"; const marketState = marketStatus?.status ?? "UNKNOWN"; const executionAllowed = @@ -1044,17 +1070,10 @@ export default function PortfolioSection() {
- {liveness} + {livenessBadgeLabel} - - {normalizedStrategyStatus} + + {strategyBadgeLabel}
@@ -1124,7 +1143,7 @@ export default function PortfolioSection() { {isStarting ? "Starting..." : "Start Strategy"}