feat: add dashboard page

This commit is contained in:
Luis Felipe Cadavid 2024-09-30 15:12:14 -05:00
parent 12c90ff120
commit 251a6a2a6a
6 changed files with 257 additions and 0 deletions

View file

@ -0,0 +1,36 @@
"use client"
import React from "react"
import { Bar, BarChart, ResponsiveContainer, XAxis, YAxis } from "recharts"
import CustomCard from "@molecules/CustomCard"
interface ChartProps {
data: Array<{ name: string; total: number }>
}
const Chart: React.FC<ChartProps> = ({ data }) => {
return (
<CustomCard title="Resumen de Ventas">
<ResponsiveContainer width="100%" height={350}>
<BarChart data={data}>
<XAxis
dataKey="name"
stroke="#888888"
fontSize={12}
tickLine={false}
axisLine={false}
/>
<YAxis
stroke="#888888"
fontSize={12}
tickLine={false}
axisLine={false}
tickFormatter={(value = 0) => `$${value}`} // Establecer valor por defecto aquí
/>
<Bar dataKey="total" fill="#1976d2" radius={[4, 4, 0, 0]} />
</BarChart>
</ResponsiveContainer>
</CustomCard>
)
}
export default Chart