'use client'; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Cell, } from 'recharts'; import { DashboardProductionEggWeights } from '@/types/api/dashboard/dashboard-production'; interface EggWeightBarChartProps { data?: DashboardProductionEggWeights[]; } const EggWeightBarChart = ({ data }: EggWeightBarChartProps) => { // Show loading state if no data if (!data || data.length === 0) { return (

Rata-rata Berat Telur (EW)

Memuat data...

); } return (

Rata-rata Berat Telur (EW)

value !== undefined ? [`${value} gram`, ''] : ['', ''] } cursor={{ fill: 'rgba(59, 130, 246, 0.1)' }} /> {data.map((entry, index) => ( ))}
); }; export default EggWeightBarChart;