From 18b490a0143118dc94368c0545d7873732c8d536 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 7 Mar 2025 15:54:04 +0800 Subject: [PATCH] chore: embeiding not available --- .../status-with-action.tsx | 17 +++++++++++------ web/app/components/datasets/documents/index.tsx | 2 ++ web/i18n/en-US/dataset.ts | 1 + web/i18n/zh-Hans/dataset.ts | 1 + 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/web/app/components/datasets/common/document-status-with-action/status-with-action.tsx b/web/app/components/datasets/common/document-status-with-action/status-with-action.tsx index a8da9bf6cc..171e99e72e 100644 --- a/web/app/components/datasets/common/document-status-with-action/status-with-action.tsx +++ b/web/app/components/datasets/common/document-status-with-action/status-with-action.tsx @@ -9,8 +9,8 @@ type Status = 'success' | 'error' | 'warning' | 'info' type Props = { type?: Status description: string - actionText: string - onAction: () => void + actionText?: string + onAction?: () => void disabled?: boolean } @@ -47,17 +47,22 @@ const StatusAction: FC = ({ const { Icon, color } = getIcon(type) return (
-
{description}
- -
{actionText}
+ {onAction && ( + <> + +
{actionText}
+ + )}
) diff --git a/web/app/components/datasets/documents/index.tsx b/web/app/components/datasets/documents/index.tsx index 3b8029a769..1005a2be1f 100644 --- a/web/app/components/datasets/documents/index.tsx +++ b/web/app/components/datasets/documents/index.tsx @@ -29,6 +29,7 @@ import { useInvalid } from '@/service/use-base' import { useChildSegmentListKey, useSegmentListKey } from '@/service/knowledge/use-segment' import useEditDocumentMetadata from '../metadata/hooks/use-edit-dataset-metadata' import DatasetMetadataDrawer from '../metadata/metadata-dataset/dataset-metadata-drawer' +import StatusWithAction from '../common/document-status-with-action/status-with-action' const FolderPlusIcon = ({ className }: React.SVGProps) => { return @@ -280,6 +281,7 @@ const Documents: FC = ({ datasetId }) => {
{!isFreePlan && } + {!embeddingAvailable && } {embeddingAvailable && (