import React from 'react'; const Sparkline = ({ data = [], height = 80, stroke = 'currentColor' }) => { if (!data || data.length === 0) return null; const max = Math.max(...data, 1); const n = data.length; const w = 400; const points = data .map((v, i) => { const x = n > 1 ? (i / (n - 1)) * w : w / 2; const y = height - (v / max) * (height - 8) - 4; return `${x.toFixed(1)},${y.toFixed(1)}`; }) .join(' '); const areaPoints = `0,${height} ${points} ${w},${height}`; return ( {data.map((v, i) => { const x = n > 1 ? (i / (n - 1)) * w : w / 2; const y = height - (v / max) * (height - 8) - 4; return ( ); })} ); }; export default Sparkline;