// --------------------------------------------------------------------------- // TickerTape — live vital-signs strip for the dashboard hero. // // A horizontal tape of small numeric readouts separated by hairline // dividers, rendered on the dark canvas. Each cell shows a label // (uppercase mono) and a value (mono). One cell can be marked // `accent` to draw the eye, and the optional `live` cell shows a // pulsing dot — the dashboard's only acknowledgement of time. // // This is a static ticker (not scrolling); the cells are just laid // out left-to-right with dividers. We use it to give the dark hero // data density without committing to a real chart. // --------------------------------------------------------------------------- import { cn } from "@/lib/utils"; export interface TickerCell { /** Stable id used as React key. */ id: string; /** Uppercase mono label (e.g. "Billed", "Pending", "Denial"). */ label: string; /** The value, rendered verbatim in mono. Format it before passing. */ value: string; /** Optional secondary value shown muted (e.g. delta). */ delta?: string; /** Highlight this cell with the accent colour. */ accent?: boolean; } export interface TickerTapeProps { cells: TickerCell[]; /** Show the "LIVE" pulse on the leading edge. */ live?: boolean; /** Live label (default "Live"). */ liveLabel?: string; className?: string; } export function TickerTape({ cells, live = false, liveLabel = "Live", className, }: TickerTapeProps) { return (
{/* Left rail — amber signal accent for the LIVE indicator */} {live ? (
{liveLabel}
) : null} {/* Cells */}
{cells.map((c, i) => (
0 ? "border-l border-border/40" : "" )} > {c.label}
{c.value} {c.delta ? ( {c.delta} ) : null}
))}
{/* Right rail — perforated tick pattern, decoratively marks the end of the tape without using a heavy border. */}
); }