(feat:upload) wording, icons and rmv clear button

This commit is contained in:
ManishMadan2882
2025-10-05 16:12:58 +05:30
parent e4554d6c09
commit eb4d776784
8 changed files with 15 additions and 39 deletions

View File

@@ -2,11 +2,7 @@ import { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useTranslation } from 'react-i18next';
import {
selectUploadTasks,
dismissUploadTask,
clearCompletedTasks,
} from '../upload/uploadSlice';
import { selectUploadTasks, dismissUploadTask } from '../upload/uploadSlice';
import ChevronDown from '../assets/chevron-down.svg';
import CheckCircleFilled from '../assets/check-circle-filled.svg';
import WarnIcon from '../assets/warn.svg';
@@ -37,7 +33,7 @@ export default function UploadToast() {
case 'uploading':
return t('modals.uploadDoc.progress.upload');
case 'training':
return t('modals.uploadDoc.progress.training');
return t('modals.uploadDoc.progress.upload');
case 'completed':
return t('modals.uploadDoc.progress.completed');
case 'failed':
@@ -100,7 +96,7 @@ export default function UploadToast() {
src={ChevronDown}
alt=""
className={`h-4 w-4 transform transition-transform duration-200 dark:invert ${
isCollapsed ? '' : 'rotate-180'
isCollapsed ? 'rotate-180' : ''
}`}
/>
</button>
@@ -228,17 +224,6 @@ export default function UploadToast() {
</div>
);
})}
{uploadTasks.some(
(task) => task.status === 'completed' || task.status === 'failed',
) && (
<button
onClick={() => dispatch(clearCompletedTasks())}
className="mt-1 mr-1 text-right text-xs text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
>
{t('modals.uploadDoc.progress.clear')}
</button>
)}
</div>
);
}

View File

@@ -260,8 +260,8 @@
},
"progress": {
"upload": "Upload is in progress",
"training": "Training is in progress",
"completed": "Training completed",
"training": "Upload is in progress",
"completed": "Upload completed",
"wait": "This may take several minutes",
"preparing": "Preparing upload",
"tokenLimit": "Over the token limit, please consider uploading smaller document",

View File

@@ -223,8 +223,8 @@
},
"progress": {
"upload": "Subida en progreso",
"training": "Entrenamiento en progreso",
"completed": "Entrenamiento completado",
"training": "Subida en progreso",
"completed": "Subida completada",
"wait": "Esto puede tardar varios minutos",
"preparing": "Preparando subida",
"tokenLimit": "Excede el límite de tokens, considere cargar un documento más pequeño",

View File

@@ -223,8 +223,8 @@
},
"progress": {
"upload": "アップロード中",
"training": "トレーニング中",
"completed": "トレーニング完了",
"training": "アップロード中",
"completed": "アップロード完了",
"wait": "数分かかる場合があります",
"preparing": "アップロードを準備中",
"tokenLimit": "トークン制限を超えています。より小さいドキュメントをアップロードしてください",

View File

@@ -223,8 +223,8 @@
},
"progress": {
"upload": "Идет загрузка",
"training": "Идет обучение",
"completed": "Обучение завершено",
"training": "Идет загрузка",
"completed": "Загрузка завершена",
"wait": "Это может занять несколько минут",
"preparing": "Подготовка загрузки",
"tokenLimit": "Превышен лимит токенов, рассмотрите возможность загрузки документа меньшего размера",

View File

@@ -223,8 +223,8 @@
},
"progress": {
"upload": "正在上傳",
"training": "正在訓練",
"completed": "訓練完成",
"training": "正在上傳",
"completed": "上傳完成",
"wait": "這可能需要幾分鐘",
"preparing": "準備上傳",
"tokenLimit": "超出令牌限制,請考慮上傳較小的文檔",

View File

@@ -223,8 +223,8 @@
},
"progress": {
"upload": "正在上传",
"training": "正在训练",
"completed": "训练完成",
"training": "正在上传",
"completed": "上传完成",
"wait": "这可能需要几分钟",
"preparing": "准备上传",
"tokenLimit": "超出令牌限制,请考虑上传较小的文档",

View File

@@ -114,14 +114,6 @@ export const uploadSlice = createSlice({
removeUploadTask: (state, action: PayloadAction<string>) => {
state.tasks = state.tasks.filter((task) => task.id !== action.payload);
},
clearCompletedTasks: (state) => {
state.tasks = state.tasks.filter(
(task) =>
task.status === 'uploading' ||
task.status === 'training' ||
task.status === 'preparing',
);
},
},
});
@@ -134,7 +126,6 @@ export const {
updateUploadTask,
dismissUploadTask,
removeUploadTask,
clearCompletedTasks,
} = uploadSlice.actions;
export const selectAttachments = (state: RootState) => state.upload.attachments;