import type { CustomerImportSummary } from "@/types/customer";

const summaryItems = [
  ["Gesamt", "total_rows"],
  ["Gültig", "valid_rows"],
  ["Fehler", "error_count"],
  ["Warnungen", "warning_count"],
  ["Creates", "create_count"],
  ["Updates", "update_count"],
  ["Skips", "skip_count"],
] as const;

export default function ImportSummaryCard({ summary }: { summary: CustomerImportSummary }) {
  return (
    <div className="grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7">
      {summaryItems.map(([label, key]) => (
        <div key={key} className="rounded-lg border bg-white p-3">
          <p className="text-xs text-slate-500">{label}</p>
          <p className="mt-1 text-xl font-semibold text-slate-950">{summary[key]}</p>
        </div>
      ))}
    </div>
  );
}
