import ChatOverviewModal from '@/components/api-service/chat-overview-modal'; import { useSetModalState, useTranslate } from '@/hooks/common-hooks'; import { useFetchFlow } from '@/hooks/flow-hooks'; import { ArrowLeftOutlined } from '@ant-design/icons'; import { Button, Flex, Space } from 'antd'; import { Link, useParams } from 'umi'; import FlowIdModal from '../flow-id-modal'; import { useSaveGraph, useSaveGraphBeforeOpeningDebugDrawer, useWatchAgentChange, } from '../hooks'; import styles from './index.less'; interface IProps { showChatDrawer(): void; chatDrawerVisible: boolean; } const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => { const { saveGraph } = useSaveGraph(); const handleRun = useSaveGraphBeforeOpeningDebugDrawer(showChatDrawer); const { data } = useFetchFlow(); const { t } = useTranslate('flow'); const { visible: overviewVisible, hideModal: hideOverviewModal, // showModal: showOverviewModal, } = useSetModalState(); const { visible, hideModal, showModal } = useSetModalState(); const { id } = useParams(); const time = useWatchAgentChange(chatDrawerVisible); return ( <>
{data.title} {t('autosaved')} {time}
{/* */}
{overviewVisible && ( )} {visible && } ); }; export default FlowHeader;