mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-02 18:45:29 +08:00
### What problem does this PR solve? feat(search): Optimized search functionality and user interface #3221 ### Type of change - Added similarity threshold adjustment function - Optimized mind map display logic - Adjusted search settings interface layout - Fixed related search and document viewing functions - Optimized time display and node selection logic - [x] Bug Fix (non-breaking change which fixes an issue)
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import IndentedTree from '@/components/indented-tree/indented-tree';
|
|
import { Progress } from '@/components/ui/progress';
|
|
import { IModalProps } from '@/interfaces/common';
|
|
import { X } from 'lucide-react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { usePendingMindMap } from '../search/hooks';
|
|
|
|
interface IProps extends IModalProps<any> {
|
|
data: any;
|
|
}
|
|
|
|
const MindMapDrawer = ({ data, hideModal, visible, loading }: IProps) => {
|
|
const { t } = useTranslation();
|
|
const percent = usePendingMindMap();
|
|
return (
|
|
<div className="w-full h-full">
|
|
<div className="flex w-full justify-between items-center mb-2">
|
|
<div className="text-text-primary font-medium text-base">
|
|
{t('chunk.mind')}
|
|
</div>
|
|
<X
|
|
className="text-text-primary cursor-pointer"
|
|
size={16}
|
|
onClick={() => {
|
|
hideModal?.();
|
|
}}
|
|
/>
|
|
</div>
|
|
{loading && (
|
|
<div className=" rounded-lg p-4 w-full h-full">
|
|
<Progress value={percent} className="h-1 flex-1 min-w-10" />
|
|
</div>
|
|
)}
|
|
{!loading && (
|
|
<div className="bg-bg-card rounded-lg p-4 w-full h-full">
|
|
<IndentedTree
|
|
data={data}
|
|
show
|
|
style={{
|
|
width: '100%',
|
|
height: '100%',
|
|
}}
|
|
></IndentedTree>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default MindMapDrawer;
|