diff --git a/web/src/pages/flow/list/agent-template-modal.tsx b/web/src/pages/flow/list/agent-template-modal.tsx index 5a90d16c7..ac19ff0de 100644 --- a/web/src/pages/flow/list/agent-template-modal.tsx +++ b/web/src/pages/flow/list/agent-template-modal.tsx @@ -1,6 +1,7 @@ import { IModalManagerChildrenProps } from '@/components/modal-manager'; import { useSetModalState, useTranslate } from '@/hooks/common-hooks'; -import { useFetchFlowTemplates } from '@/hooks/flow-hooks'; +import { IFlowTemplate } from '@/interfaces/database/flow'; +// import { useFetchFlowTemplates } from '@/hooks/flow-hooks'; import { useSelectItem } from '@/hooks/logic-hooks'; import { Button, Card, Flex, List, Modal, Typography } from 'antd'; import { useCallback, useState } from 'react'; @@ -15,11 +16,18 @@ interface IProps extends Omit { loading: boolean; onOk: (name: string, templateId: string) => void; showModal?(): void; + templateList: IFlowTemplate[]; } -const AgentTemplateModal = ({ visible, hideModal, loading, onOk }: IProps) => { +const AgentTemplateModal = ({ + visible, + hideModal, + loading, + onOk, + templateList, +}: IProps) => { const { t } = useTranslate('common'); - const { data: list } = useFetchFlowTemplates(); + // const { data: list } = useFetchFlowTemplates(); const { selectedId, handleItemClick } = useSelectItem(''); const [checkedId, setCheckedId] = useState(''); @@ -62,7 +70,7 @@ const AgentTemplateModal = ({ visible, hideModal, loading, onOk }: IProps) => { ( { onFlowOk, flowSettingVisible, hideFlowSettingModal, + templateList: list, showFlowSettingModal: showFileRenameModal, }; }; diff --git a/web/src/pages/flow/list/index.tsx b/web/src/pages/flow/list/index.tsx index 0c624e65f..9bc0a845d 100644 --- a/web/src/pages/flow/list/index.tsx +++ b/web/src/pages/flow/list/index.tsx @@ -24,6 +24,7 @@ const FlowList = () => { hideFlowSettingModal, flowSettingVisible, flowSettingLoading, + templateList, onFlowOk, } = useSaveFlow(); const { t } = useTranslate('flow'); @@ -110,6 +111,7 @@ const FlowList = () => { onOk={onFlowOk} loading={flowSettingLoading} hideModal={hideFlowSettingModal} + templateList={templateList} > )}