import Link from 'next/link'; import type { IndexRow } from '@/lib/queries/indices'; import { fmtNum, cn, fmtPct, deltaClass } from '@/lib/format'; /** * Live tape (§163, §194): a terminal-style ticker of the PUBLISHED indices only — value + daily change. * Indices that have not met their constituent minimum are not in the tape; they are listed in a secondary * compact "Indices in development" line with their constituent progress. Pauses on hover/focus; static under * reduced motion. */ export function IndexTape({ indices, className }: { indices: IndexRow[]; className?: string }) { if (!indices.length) return null; const published = indices.filter((i) => i.latest).sort((a, b) => Number(b.isFlagship) - Number(a.isFlagship) || a.ticker.localeCompare(b.ticker)); const developing = indices.filter((i) => !i.latest).sort((a, b) => b.pricedAssets / Math.max(1, b.minConstituents) - a.pricedAssets / Math.max(1, a.minConstituents)); const items = published.map((i) => { const up = (i.change1d ?? 0) > 0; const down = (i.change1d ?? 0) < 0; return ( {i.ticker} {fmtNum(i.latest!.value, { digits: 2 })} {up ? '▲' : down ? '▼' : '■'} {fmtPct(i.change1d)} ); }); return (