import type { ReactNode } from 'react'; export type TickerItem = { key: string; label: ReactNode; changePct: number; active?: boolean; }; type Props = { items: TickerItem[]; className?: string; }; function formatPct(v: number): string { const s = v >= 0 ? '+' : ''; return `${s}${v.toFixed(2)}%`; } export default function TickerBar({ items, className }: Props) { return (
{items.map((t) => (
{t.label} = 0 ? 'pos' : 'neg'].join(' ')}>{formatPct(t.changePct)}
))}
); }