"use client"; import { Bar, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, BarChart } from "recharts"; import { useI18n } from "@/lib/i18n/useI18n"; type Row = { reasonLabel: string; minutes: number; count: number; }; type Props = { rows: Row[]; }; export default function RecapDowntimeTop({ rows }: Props) { const { t } = useI18n(); const data = rows.slice(0, 3).map((row) => ({ ...row, label: row.reasonLabel.slice(0, 20) })); return (
{t("recap.downtime.title")}
{data.length === 0 ? (
{t("recap.empty.production")}
) : ( <>
{data.map((row) => (
{row.reasonLabel} {row.minutes.toFixed(1)} min ยท {row.count}
))}
)}
); }