/* ============================================================================ VIEW 3 — WATCHLIST (filterable tracked tickers) ============================================================================ */ const { useState:useStateWL } = React; const STATUS_STYLE = { "New": { c:"#7aa7ff", bg:"rgba(122,167,255,0.12)", b:"rgba(122,167,255,0.35)" }, "Tracking": { c:"var(--text-2)", bg:"var(--fill-strong)", b:"var(--line)" }, "Triggered": { c:"#15bd80", bg:"rgba(31,224,160,0.12)", b:"rgba(31,224,160,0.4)" }, "Dropped": { c:"#8a929e", bg:"var(--fill-soft)", b:"var(--line)" }, }; function StatusTag({ status }){ const s = STATUS_STYLE[status] || STATUS_STYLE["Tracking"]; const dropped = status==="Dropped"; return ( {status==="Triggered" && } {status} ); } function FilterPills({ label, options, value, onChange }){ return (
{label} {["All",...options].map(o=>( ))}
); } function Watchlist({ rows, onOpen }){ const [tier, setTier] = useStateWL("All"); const [sector, setSector] = useStateWL("All"); const sectors = [...new Set(rows.map(r=>r.sector))]; const filtered = rows.filter(r=> (tier==="All"||r.tier===tier) && (sector==="All"||r.sector===sector)) .sort((a,b)=> TIER_ORDER[a.tier]-TIER_ORDER[b.tier] || b.conviction-a.conviction); const cols = ["Ticker","Tier","Conviction","Trend","Price","Sector","Days","Status"]; return (

Watchlist

{filtered.length} of {rows.length} tracked tickers

{cols.map((c,i)=>( ))} {filtered.map(r=>{ const t = tierOf(r.tier); const dropped = r.status==="Dropped"; return ( onOpen(r.ticker)} className="ss-trow cursor-pointer" style={{borderBottom:"1px solid var(--line)", opacity:dropped?0.6:1}}> ); })}
=4&&i<=6?"text-right":"text-left")} style={{color:"var(--muted)"}}>{c}
{r.ticker}
{r.conviction}
{fmtPrice(r.price)}
{r.sector} {r.days_tracked}
{!filtered.length &&
No tickers match these filters.
}
); } Object.assign(window, { Watchlist });