diff --git a/web/src/features/import/index.tsx b/web/src/features/import/index.tsx index 334d523..da94f04 100644 --- a/web/src/features/import/index.tsx +++ b/web/src/features/import/index.tsx @@ -363,196 +363,20 @@ export default function ImportPage() { + {!accountId && ( +

+ + {t('import.selectAccountRequired', 'Please select a target account before importing.')} +

+ )} - - {/* Step 2: Folder determination mode */} + {/* Step 2: File upload */} - {isPstSelected - ? t('import.folderStructure', '2. Folder structure') - : t('import.folderMethod', '2. Choose folder method')} - - - {isPstSelected - ? t('import.pstFolderDesc', 'The PST file contains its own folder structure (e.g. Inbox, Sent Items, etc.). Folders will be automatically created during import.') - : files.length === 0 - ? t('import.selectFileFirst', 'Select a file first to determine available options.') - : t('import.folderMethodDesc', 'How should the target mail folder be determined?')} - - - - {!isPstSelected && ( - handleModeChange(v as FolderMode)} - className="gap-3" - > - {/* Mode 1: Auto-detect from headers */} - - - {/* Mode 2: Pick from existing mailboxes */} - - - {/* Mode 3: Manual input */} - - - )} - - - - {/* Step 3: File upload */} - - - - {t('import.chooseFiles', '3. Choose files')} + {t('import.chooseFiles', '2. Choose files')} {t('import.limits', { @@ -631,9 +455,194 @@ export default function ImportPage() { ))} )} + {files.length === 0 && phase === 'idle' && ( +
+ + {t('import.noFilesSelected')} +
+ )}
+ {/* Step 3: Folder determination mode */} + + + + {isPstSelected + ? t('import.folderStructure', '3. Folder structure') + : t('import.folderMethod', '3. Choose folder method')} + + + {isPstSelected + ? t('import.pstFolderDesc', 'The PST file contains its own folder structure (e.g. Inbox, Sent Items, etc.). Folders will be automatically created during import.') + : files.length === 0 + ? t('import.selectFileFirst', 'Select a file first to determine available options.') + : t('import.folderMethodDesc', 'How should the target mail folder be determined?')} + + + + {!isPstSelected && ( + handleModeChange(v as FolderMode)} + className="gap-3" + > + {/* Mode 1: Auto-detect from headers */} + + {/* Mode 2: Pick from existing mailboxes */} + + + {/* Mode 3: Manual input */} + + + )} + + {/* Step 4: Progress & Results */} {(phase !== 'idle' || progress) && ( @@ -707,27 +716,43 @@ export default function ImportPage() { )} - {/* Import button */} -
-
- {isPstSelected - ? t('import.pstFolders', 'PST folder structure will be preserved during import') - : (<>{t('import.willImportTo', 'Will import to')}: {effectiveFolder}{files.length > 1 && <> · {t('import.fileCount', { count: files.length })}})} +
+
+
+ {isPstSelected + ? t('import.pstFolders', 'PST folder structure will be preserved during import') + : (<>{t('import.willImportTo', 'Will import to')}: {effectiveFolder}{files.length > 1 && <> · {t('import.fileCount', { count: files.length })}})} +
+
- + {(!accountId || files.length === 0) && ( +
+ + + {!accountId && !files.length && ( + t('import.selectAccountAndFiles', 'Please select a target account and files first.') + )} + {!accountId && files.length > 0 && ( + t('import.selectAccountRequired', 'Please select a target account first.') + )} + {accountId && files.length === 0 && ( + t('import.selectFilesRequired', 'Please select files to import.') + )} + +
+ )}
- {/* Import history */} {history.length > 0 && (