import { useId } from 'react' import { Download, FileDown } from 'lucide-react' import type { PackingState } from './usePackingListPanel' import { PACKING_IMPORT_ACCEPT } from './packingListPanel.constants' import { DialogButton, DialogFooter, DialogHeader, DialogShell, DialogTile, FooterSpacer, NEUTRAL_TINT, fs } from '../shared/DialogShell' /** Pasting a list or loading a file: one item per line, numbered as it is typed. */ export function BulkImportModal(S: PackingState) { const { setShowImportModal, t, importText, setImportText, csvInputRef, handleCsvFile, handleBulkImport, parseImportLines } = S const labelId = useId() const close = () => setShowImportModal(false) const text = fs(13, 'body') return ( } tint={NEUTRAL_TINT} labelId={labelId} onClose={close} title={t('packing.importTitle')} /> )} footer={( } onClick={() => csvInputRef.current?.click()}>{t('packing.importCsv')} {t('common.cancel')} {t('packing.importAction', { count: parseImportLines(importText).length })} )} >

{t('packing.importHint')}
{t('packing.importHintMarkdown')}

{(importText || ' ').split('\n').map((_, i) => (
{i + 1}
))}