import { useTranslation } from "react-i18next"; import { AlertCircle } from "lucide-react"; import type { ParsedRow } from "../../shared/types"; interface FilePreviewTableProps { rows: ParsedRow[]; } export default function FilePreviewTable({ rows, }: FilePreviewTableProps) { const { t } = useTranslation(); if (rows.length === 0) { return (
| # | {t("import.preview.date")} | {t("import.preview.description")} | {t("import.preview.amount")} | {t("import.preview.raw")} |
|---|---|---|---|---|
| {row.rowIndex + 1} | {row.parsed?.date || ( {row.error || "—"} )} | {row.parsed?.description || "—"} | {row.parsed?.amount != null ? row.parsed.amount.toFixed(2) : "—"} | {row.raw.join(" | ")} |