diff --git a/web/app/components/datasets/documents/detail/completed/batch-action.tsx b/web/app/components/datasets/documents/detail/completed/batch-action.tsx index b464334c14..542a861723 100644 --- a/web/app/components/datasets/documents/detail/completed/batch-action.tsx +++ b/web/app/components/datasets/documents/detail/completed/batch-action.tsx @@ -1,8 +1,12 @@ import React, { type FC } from 'react' import { RiArchive2Line, RiCheckboxCircleLine, RiCloseCircleLine, RiDeleteBinLine } from '@remixicon/react' +import { useTranslation } from 'react-i18next' +import { useBoolean } from 'ahooks' import Divider from '@/app/components/base/divider' import classNames from '@/utils/classnames' +import Confirm from '@/app/components/base/confirm' +const i18nPrefix = 'dataset.batchAction' type IBatchActionProps = { className?: string selectedIds: string[] @@ -22,6 +26,11 @@ const BatchAction: FC = ({ onBatchDelete, onCancel, }) => { + const { t } = useTranslation() + const [isShowDeleteConfirm, { + setTrue: showDeleteConfirm, + setFalse: hideDeleteConfirm, + }] = useBoolean(false) return (
@@ -29,41 +38,53 @@ const BatchAction: FC = ({ {selectedIds.length} - Selected + {t(`${i18nPrefix}.selected`)}
{onArchive && (
)}
-
+ { + isShowDeleteConfirm && ( + + ) + } ) } diff --git a/web/i18n/en-US/dataset.ts b/web/i18n/en-US/dataset.ts index 59f105adca..75eda76a24 100644 --- a/web/i18n/en-US/dataset.ts +++ b/web/i18n/en-US/dataset.ts @@ -150,6 +150,14 @@ const translation = { nTo1RetrievalLegacy: 'N-to-1 retrieval will be officially deprecated from September. It is recommended to use the latest Multi-path retrieval to obtain better results. ', nTo1RetrievalLegacyLink: 'Learn more', nTo1RetrievalLegacyLinkText: ' N-to-1 retrieval will be officially deprecated in September.', + batchAction: { + selected: 'Selected', + enable: 'Enable', + disable: 'Disable', + archive: 'Archive', + delete: 'Delete', + cancel: 'Cancel', + }, } export default translation diff --git a/web/i18n/zh-Hans/dataset.ts b/web/i18n/zh-Hans/dataset.ts index 801a974cbc..1d4897a69f 100644 --- a/web/i18n/zh-Hans/dataset.ts +++ b/web/i18n/zh-Hans/dataset.ts @@ -150,6 +150,14 @@ const translation = { nTo1RetrievalLegacy: '9 月 1 日起我们将不再提供此能力,推荐使用最新的多路召回获得更好的检索效果。', nTo1RetrievalLegacyLink: '了解更多', nTo1RetrievalLegacyLinkText: '9 月 1 日起我们将不再提供此能力。', + batchAction: { + selected: '已选择', + enable: '启用', + disable: '禁用', + archive: '归档', + delete: '删除', + cancel: '取消', + }, } export default translation