mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: catch errors when sending messages #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
47 lines
1.0 KiB
TypeScript
47 lines
1.0 KiB
TypeScript
import { Button, Flex, Space } from 'antd';
|
|
|
|
import { useFetchFlow } from '@/hooks/flow-hooks';
|
|
import { ArrowLeftOutlined } from '@ant-design/icons';
|
|
import { Link } from 'umi';
|
|
import { useSaveGraph } from '../hooks';
|
|
|
|
import styles from './index.less';
|
|
|
|
interface IProps {
|
|
showChatDrawer(): void;
|
|
}
|
|
|
|
const FlowHeader = ({ showChatDrawer }: IProps) => {
|
|
const { saveGraph } = useSaveGraph();
|
|
|
|
const { data } = useFetchFlow();
|
|
|
|
return (
|
|
<>
|
|
<Flex
|
|
align="center"
|
|
justify={'space-between'}
|
|
gap={'large'}
|
|
className={styles.flowHeader}
|
|
>
|
|
<Space size={'large'}>
|
|
<Link to={`/flow`}>
|
|
<ArrowLeftOutlined />
|
|
</Link>
|
|
<h3>{data.title}</h3>
|
|
</Space>
|
|
<Space size={'large'}>
|
|
<Button onClick={showChatDrawer}>
|
|
<b>Debug</b>
|
|
</Button>
|
|
<Button type="primary" onClick={saveGraph}>
|
|
<b>Save</b>
|
|
</Button>
|
|
</Space>
|
|
</Flex>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default FlowHeader;
|