"use client"; import { ResponsiveContainer, AreaChart, Area } from "recharts"; type Props = { data: (number | null)[]; color: string; height?: number; }; export function Sparkline({ data, color, height = 36 }: Props) { const points = data.map((v, i) => ({ i, v: v ?? 0 })); const max = Math.max(0.001, ...data.filter((v): v is number => v != null)); // Pad values: if all 0, draw a flat line at 0 for visual presence const flat = data.every((v) => !v); const displayData = flat ? points.map((p) => ({ ...p, v: 1 })) : points; const displayMax = flat ? 1 : max; return (