"use client"; import { useI18n } from "@/lib/i18n/useI18n"; import type { RecapSkuRow } from "@/lib/recap/types"; type Props = { rows: RecapSkuRow[]; }; export default function RecapProductionBySku({ rows }: Props) { const { t } = useI18n(); return (
{t("recap.production.title")}
{rows.length === 0 ? (
{t("recap.empty.production")}
) : (
SKU
{t("recap.production.good")}
{t("recap.production.scrap")}
{t("recap.production.target")}
{t("recap.production.progress")}
{rows.slice(0, 8).map((row) => { const pct = row.progressPct == null ? "--" : `${Math.round(row.progressPct)}%`; return (
{row.sku}
{row.good}
0 ? "text-red-400" : "text-zinc-200"}>{row.scrap}
{row.target ?? "--"}
{pct}
); })}
)}
); }