feat: dashboard UI with product cards + sparklines
This commit is contained in:
14
src/components/Sparkline.tsx
Normal file
14
src/components/Sparkline.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
'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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user