"use client"; import { useI18n } from "@/lib/i18n/useI18n"; import { formatRecapProgressPercent } from "@/lib/recap/progressDisplay"; import type { RecapSkuRow } from "@/lib/recap/types"; type Props = { rows: RecapSkuRow[]; }; export default function RecapProductionBySku({ rows }: Props) { const { t, locale } = useI18n(); return (
{t("recap.production.bySku")}
{rows.length === 0 ? (
{t("recap.empty.production")}
) : (
{rows.slice(0, 10).map((row) => { const progress = row.progressPct == null ? "—" : formatRecapProgressPercent(row.progressPct, locale); return ( ); })}
{t("recap.production.sku")} {t("recap.production.good")} {t("recap.production.scrap")} {t("recap.production.target")} {t("recap.production.progress")}
{row.sku} {row.good} 0 ? "text-red-300" : ""}`}>{row.scrap} {row.target ?? "--"} {progress}
)}
); }