({
mapped,
unmapped,
activeCategories,
onSelectMarket,
}: {
mapped: ProcessedMarket[];
unmapped: ProcessedMarket[];
activeCategories: Set<Category>;
onSelectMarket: (m: ProcessedMarket) => void;
})
| 175 | |
| 176 | // --- Detail empty state: show top movers --- |
| 177 | function DetailEmptyState({ |
| 178 | mapped, |
| 179 | unmapped, |
| 180 | activeCategories, |
| 181 | onSelectMarket, |
| 182 | }: { |
| 183 | mapped: ProcessedMarket[]; |
| 184 | unmapped: ProcessedMarket[]; |
| 185 | activeCategories: Set<Category>; |
| 186 | onSelectMarket: (m: ProcessedMarket) => void; |
| 187 | }) { |
| 188 | const all = [...mapped, ...unmapped]; |
| 189 | const topMovers = all |
| 190 | .filter((m) => activeCategories.has(m.category) && m.change !== null && !isNaN(m.change!)) |
| 191 | .sort((a, b) => Math.abs(b.change!) - Math.abs(a.change!)) |
| 192 | .slice(0, 5); |
| 193 | |
| 194 | return ( |
| 195 | <div className="p-2 font-mono"> |
| 196 | <div className="text-[11px] text-[#777] mb-2"> |
| 197 | select a market to view full details |
| 198 | </div> |
| 199 | {topMovers.length > 0 && ( |
| 200 | <> |
| 201 | <div className="text-[10px] uppercase tracking-[0.1em] text-[#777] mb-1.5">top movers</div> |
| 202 | {topMovers.map((m) => ( |
| 203 | <MarketCard key={m.id} market={m} showChange onClick={() => onSelectMarket(m)} /> |
| 204 | ))} |
| 205 | </> |
| 206 | )} |
| 207 | </div> |
| 208 | ); |
| 209 | } |
| 210 | |
| 211 | // --- Country empty state: show countries with most markets --- |
| 212 | function TopCountries({ |
nothing calls this directly
no outgoing calls
no test coverage detected