import { ArrowDownRight, ArrowUpRight } from "lucide-react"; import type { ReactNode } from "react"; import { cn } from "@/lib/utils"; export interface InsightCardTrend { /** A percentage or plain number; the sign is implied by direction, not this value. */ value: number; direction: "up" | "down"; } export interface InsightCardProps { label: string; /** The headline number. Pass a NumberTicker for it to roll in on change. */ value: ReactNode; trend?: InsightCardTrend; icon?: ReactNode; className?: string; } /** A stat tile: a label, a headline value, and an optional trend pill. */ export function InsightCard({ label, value, trend, icon, className }: InsightCardProps) { return (
{label} {icon ? ( ) : null}
{value} {trend ? ( {trend.direction === "up" ? ( ) : null}
); }