feat: add dashboard page
This commit is contained in:
parent
12c90ff120
commit
251a6a2a6a
6 changed files with 257 additions and 0 deletions
36
package/components/organisms/Dashboard/Chart.tsx
Normal file
36
package/components/organisms/Dashboard/Chart.tsx
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue