Per-strategy type badges with color coding + asset labels
reversal: blue (OBI, Mean Reversion) momentum: amber (Iceberg, Momentum Breakout) stat_arb: purple (Pairs, Kalman Pairs) carry: cyan (Funding Rate Arb) market_making: emerald (Avellaneda-Stoikov) Each card now shows: [TYPE badge] [ASSET] [status] [maker/taker]
This commit is contained in:
@@ -23,6 +23,17 @@ export function StrategyCard({ name, strategy, tab, onClick, badge, stats, pnlPc
|
||||
const isUp = equity >= strategy.allocation;
|
||||
const pnl = strategy.pnl ?? 0;
|
||||
const pnlPctVal = strategy.pnl_pct ?? 0;
|
||||
// Type colors
|
||||
const typeColors: Record<string, string> = {
|
||||
reversal: "bg-blue-500/20 text-blue-400",
|
||||
momentum: "bg-amber-500/20 text-amber-400",
|
||||
stat_arb: "bg-purple-500/20 text-purple-400",
|
||||
carry: "bg-cyan-500/20 text-cyan-400",
|
||||
market_making: "bg-emerald-500/20 text-emerald-400",
|
||||
};
|
||||
const typeColor = typeColors[strategy.type] || "bg-gray-500/20 text-gray-400";
|
||||
// Asset shorthand
|
||||
const assetShort = strategy.instrument?.split("-")[0] || "";
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -32,9 +43,10 @@ export function StrategyCard({ name, strategy, tab, onClick, badge, stats, pnlPc
|
||||
<div className="flex items-start justify-between mb-2">
|
||||
<div>
|
||||
<p className="text-xs font-semibold leading-tight">{name}</p>
|
||||
<p className="text-[9px] text-muted-foreground mt-0.5">
|
||||
${strategy.allocation} · {strategy.type}
|
||||
</p>
|
||||
<div className="flex gap-1 mt-0.5">
|
||||
<span className={`text-[8px] px-1.5 py-px rounded font-mono ${typeColor}`}>{strategy.type}</span>
|
||||
<span className="text-[9px] text-muted-foreground">{assetShort}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-1">
|
||||
<Badge variant={strategy.status === "running" ? "default" : "secondary"} className="text-[8px] h-4 px-1.5">
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user