interface Props { data: number[]; width?: number; height?: number; className?: string; } export default function PriceSparkline({ data, width = 80, height = 24, className = '' }: Props) { if (data.length < 2) return null; const min = Math.min(...data); const max = Math.max(...data); const range = max - min || 1; const padding = 1; const points = data.map((val, i) => { const x = padding + (i / (data.length - 1)) * (width - padding * 2); const y = padding + (1 - (val - min) / range) * (height - padding * 2); return `${x},${y}`; }).join(' '); // Color based on trend: green if last < first, red if up, gray if flat const trend = data[data.length - 1] - data[0]; const color = trend < 0 ? '#4ade80' : trend > 0 ? '#f87171' : '#6b7280'; return ( {/* Dot at current (last) price */} ); }