'use client'
import { LineChart, Line, ResponsiveContainer, YAxis } from 'recharts'

export function Sparkline({ data }: { data: Array<{ price: number; t: string }> }) {
  if (data.length === 0) return <div className="h-10 text-xs text-zinc-500">keine Daten</div>
  return (
    <ResponsiveContainer width="100%" height={40}>
      <LineChart data={data}>
        <YAxis hide domain={['dataMin', 'dataMax']} />
        <Line type="monotone" dataKey="price" stroke="#22c55e" strokeWidth={2} dot={false} isAnimationActive={false} />
      </LineChart>
    </ResponsiveContainer>
  )
}
