mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-04 09:35:06 +08:00
### What problem does this PR solve? feat: Display mindmap in drawer #2247 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
36
web/src/pages/search/mindmap-drawer.tsx
Normal file
36
web/src/pages/search/mindmap-drawer.tsx
Normal file
@ -0,0 +1,36 @@
|
||||
import IndentedTree from '@/components/indented-tree/indented-tree';
|
||||
import { IModalProps } from '@/interfaces/common';
|
||||
import { Drawer, Flex, Progress } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { usePendingMindMap } from './hooks';
|
||||
|
||||
interface IProps extends IModalProps<any> {
|
||||
data: any;
|
||||
}
|
||||
|
||||
const MindMapDrawer = ({ data, hideModal, visible, loading }: IProps) => {
|
||||
const { t } = useTranslation();
|
||||
const percent = usePendingMindMap();
|
||||
return (
|
||||
<Drawer
|
||||
title={t('chunk.mind')}
|
||||
onClose={hideModal}
|
||||
open={visible}
|
||||
width={'40vw'}
|
||||
>
|
||||
{loading ? (
|
||||
<Flex justify="center">
|
||||
<Progress type="circle" percent={percent} size={200} />
|
||||
</Flex>
|
||||
) : (
|
||||
<IndentedTree
|
||||
data={data}
|
||||
show
|
||||
style={{ width: '100%', height: '100%' }}
|
||||
></IndentedTree>
|
||||
)}
|
||||
</Drawer>
|
||||
);
|
||||
};
|
||||
|
||||
export default MindMapDrawer;
|
||||
Reference in New Issue
Block a user