+
+
+
+
+ {t('quotes.priceImport.title', { label })}
+
+
{t('quotes.priceImport.hint', { label })}
+
+
+
+
+
+
+
+
+
+ void handleFile(e.target.files?.[0])} />
+ {step === 'pick' && (
+
+ )}
+ {fileName && {fileName}}
+ {step === 'mapping' && parsed && (
+
+ {t('quotes.priceImport.mappingHint')}
+
+ )}
+ {step === 'preview' && plan && (
+
+ {t('quotes.priceImport.summary', { matched: plan.matched, skipped: plan.skipped, failed: plan.failed })}
+
+ )}
+
+ {error && (
+
+ )}
+
+
+
+ {step === 'pick' && (
+
+ {t('quotes.priceImport.pickHint', { label })}
+
+ )}
+
+ {step === 'mapping' && parsed && (
+
+
{t('quotes.priceImport.mappingTitle')}
+ {missing.length > 0 && (
+
+
+ {t('bulkImport.mapping.missingRequired', { fields: missing.map((f) => f.label).join(t('bulkImport.mapping.listSep')) })}
+
+ )}
+
+
+
+
+ | {t('bulkImport.mapping.col.systemField')} |
+ {t('bulkImport.mapping.col.sourceColumn')} |
+ {t('bulkImport.mapping.col.sample')} |
+
+
+
+ {fields.map((field) => {
+ const sourceHeader = fieldToHeader[field.key] || '';
+ const conf = sourceHeader ? confidence[sourceHeader] : 'none';
+ const sample = sourceHeader ? parsed.rows.slice(0, 2).map((r) => r[sourceHeader]).filter(Boolean).join(' / ') : '';
+ return (
+
+ |
+ {field.label}
+ {field.required && *}
+ {sourceHeader && conf === 'medium' && {t('bulkImport.mapping.confidence.medium')} }
+ {sourceHeader && conf === 'high' && {t('bulkImport.mapping.confidence.high')} }
+ |
+
+
+ |
+ {sample || '—'} |
+
+ );
+ })}
+
+
+
+
+ )}
+
+ {step === 'preview' && plan && (
+
+
+
+ | {t('quotes.priceImport.colName')} |
+ {t('quotes.priceImport.colSpec')} |
+ {t('quotes.priceImport.colLine')} |
+ {t('quotes.priceImport.colOld')} |
+ {t('quotes.priceImport.colNew')} |
+ {t('quotes.priceImport.colStatus')} |
+
+
+
+ {plan.rows.map((row) => (
+
+ | {row.name || '-'} |
+ {row.spec || '-'} |
+ {row.lineLabel || '-'} |
+ {row.oldValue ?? '-'} |
+ {row.newValue || '-'} |
+
+ {row.status === 'matched' ? (
+ {t('quotes.priceImport.statusMatched')}
+ ) : row.status === 'skipped' ? (
+ {t('quotes.priceImport.statusSkipped')}{row.reason ? `:${row.reason}` : ''}
+ ) : (
+ {t('quotes.priceImport.statusFailed')}{row.reason ? `:${row.reason}` : ''}
+ )}
+ |
+
+ ))}
+
+
+ )}
+
+
+
+ {step === 'mapping' && (
+
+ )}
+ {step === 'preview' && (
+
+ )}
+
+ {step === 'mapping' ? (
+
+ ) : step === 'preview' ? (
+
+ ) : null}
+
+