From d88bb7042703d358166055430a1577948a09c5dd Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 11 Dec 2024 18:13:34 +0800 Subject: [PATCH] fix: loding and empty css --- .../components/datasets/hit-testing/index.tsx | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/web/app/components/datasets/hit-testing/index.tsx b/web/app/components/datasets/hit-testing/index.tsx index f82edf0267..2a0a4aeb8a 100644 --- a/web/app/components/datasets/hit-testing/index.tsx +++ b/web/app/components/datasets/hit-testing/index.tsx @@ -11,7 +11,6 @@ import Textarea from './textarea' import s from './style.module.css' import HitDetail from './hit-detail' import ModifyRetrievalModal from './modify-retrieval-modal' -import { generalResultData } from './assets/test-data' import ResultItem from './components/result-item' import cn from '@/utils/classnames' import type { ExternalKnowledgeBaseHitTestingResponse, ExternalKnowledgeBaseHitTesting as ExternalKnowledgeBaseHitTestingType, HitTestingResponse, HitTesting as HitTestingType } from '@/models/datasets' @@ -25,6 +24,8 @@ import DatasetDetailContext from '@/context/dataset-detail' import type { RetrievalConfig } from '@/types/app' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import useTimestamp from '@/hooks/use-timestamp' +import docStyle from '@/app/components/datasets/documents/detail/completed/style.module.css' + const limit = 10 type Props = { @@ -88,14 +89,12 @@ const HitTesting: FC = ({ datasetId }: Props) => { ) const renderEmptyState = () => ( - // for test -
- //
- //
- //
- // {t('datasetHitTesting.hit.emptyTip')} - //
- //
+
+
+
+ {t('datasetHitTesting.hit.emptyTip')} +
+
) useEffect(() => { @@ -174,20 +173,13 @@ const HitTesting: FC = ({ datasetId }: Props) => {
- {renderHitResults(generalResultData)} + {/* {renderHitResults(generalResultData)} */} {submitLoading - ?
- - -
+ ? : ( (() => { if (!hitResult?.records.length && !externalHitResult?.records.length)