diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index f75cc42433..606e1da703 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -36,10 +36,10 @@ import type { FormValue } from '@/app/components/header/account-setting/model-pr import InstructionEditorInWorkflow from './instruction-editor-in-workflow' import InstructionEditorInBasic from './instruction-editor' import { GeneratorType } from './types' -import Link from 'next/link' import Result from './result' import useGenData from './use-gen-data' import IdeaOutput from './idea-output' +import ResPlaceholder from './res-placeholder' const i18nPrefix = 'appDebug.generate' export type IGetAutomaticResProps = { @@ -183,16 +183,6 @@ const GetAutomaticRes: FC = ({ ) - const renderNoData = ( -
- -
-
{t('appDebug.generate.newNoDataLine1')}
- {t('appDebug.generate.newNoDataLine2')} -
-
- ) - const handleModelChange = useCallback((newValue: { modelId: string; provider: string; mode?: string; features?: string[] }) => { const newModel = { ...model, @@ -376,7 +366,7 @@ const GetAutomaticRes: FC = ({ )} {isLoading && renderLoading} - {isShowAutoPromptResPlaceholder() && !renderNoData} + {isShowAutoPromptResPlaceholder() && } {isShowConfirmOverwrite && ( { + const { t } = useTranslation() + return ( +
+ +
+
{t('appDebug.generate.newNoDataLine1')}
+ {t('appDebug.generate.newNoDataLine2')} +
+
+ ) +} +export default React.memo(ResPlaceholder) diff --git a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx index f4e5801634..fb69ca0d11 100644 --- a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx +++ b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx @@ -23,6 +23,7 @@ import { GeneratorType } from '../automatic/types' import InstructionEditor from '../automatic/instruction-editor-in-workflow' import useGenData from '../automatic/use-gen-data' import Result from '../automatic/result' +import ResPlaceholder from '../automatic/res-placeholder' const i18nPrefix = 'appDebug.generate' export type IGetCodeGeneratorResProps = { @@ -179,15 +180,6 @@ export const GetCodeGeneratorResModal: FC = (
{t('appDebug.codegen.loading')}
) - const renderNoData = ( -
- -
-
{t('appDebug.codegen.noDataLine1')}
-
{t('appDebug.codegen.noDataLine2')}
-
-
- ) return ( = ( {isLoading && renderLoading} - {!isLoading && !current && renderNoData} + {!isLoading && !current && } {(!isLoading && current) && (