feat: cockpit
This commit is contained in:
@@ -34,7 +34,7 @@ export default function TradeRankList({ trades, mode, title, linkTo, toggle, tic
|
||||
const isBear = t.strategy?.toLowerCase().includes('put') || t.strategy?.toLowerCase().includes('bear')
|
||||
const entryDate = t.entry_date ? t.entry_date.slice(0, 10) : null
|
||||
return (
|
||||
<div key={i} className="flex items-center gap-1.5 text-[10px]">
|
||||
<div key={i} className="flex items-center gap-1.5 text-[10px] rounded px-1 -mx-1 py-0.5 hover:bg-dark-700/40 transition-colors">
|
||||
<span className="text-[9px] text-slate-700 font-mono w-3 shrink-0">{i + 1}</span>
|
||||
<span className="shrink-0">{isBear ? '🐻' : '🐂'}</span>
|
||||
<span className="font-mono text-slate-200 font-bold shrink-0">
|
||||
|
||||
@@ -228,14 +228,18 @@ export default function Dashboard() {
|
||||
}
|
||||
const underlyingDisplayName = (underlying: string): string => {
|
||||
if (!underlying) return underlying
|
||||
const upper = underlying.toUpperCase()
|
||||
const watchlistTickers = new Set(((watchlistItems as any[]) ?? []).map(w => w.ticker.toUpperCase()))
|
||||
const upper = underlying.trim().toUpperCase()
|
||||
const watchlistTickers = new Set(((watchlistItems as any[]) ?? []).map(w => String(w.ticker).trim().toUpperCase()))
|
||||
const baseTicker = upper.replace(/(=X|=F)$/, '')
|
||||
if (watchlistTickers.has(upper)) return upper
|
||||
if (watchlistTickers.has(baseTicker)) return baseTicker
|
||||
const alias = UNDERLYING_ALIASES[upper]
|
||||
if (alias && watchlistTickers.has(alias)) return alias
|
||||
return underlying
|
||||
let resolved = underlying
|
||||
if (watchlistTickers.has(upper)) resolved = upper
|
||||
else if (watchlistTickers.has(baseTicker)) resolved = baseTicker
|
||||
else {
|
||||
const alias = UNDERLYING_ALIASES[upper]
|
||||
if (alias && watchlistTickers.has(alias)) resolved = alias
|
||||
}
|
||||
console.warn('[TradesOverview] underlyingDisplayName', { raw: underlying, upper, baseTicker, watchlistTickers: Array.from(watchlistTickers), resolved })
|
||||
return resolved
|
||||
}
|
||||
|
||||
// Patterns from the last cycle only (filter by created_at >= cycle started_at)
|
||||
|
||||
Reference in New Issue
Block a user