mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 08:06:48 +08:00
### What problem does this PR solve? Feat: Modify the data structure of the chunk in the conversation #3909 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,14 +1,16 @@
|
||||
import { useSetModalState } from '@/hooks/common-hooks';
|
||||
import { IChunk } from '@/interfaces/database/knowledge';
|
||||
import { IReferenceChunk } from '@/interfaces/database/chat';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
export const useClickDrawer = () => {
|
||||
const { visible, showModal, hideModal } = useSetModalState();
|
||||
const [selectedChunk, setSelectedChunk] = useState<IChunk>({} as IChunk);
|
||||
const [selectedChunk, setSelectedChunk] = useState<IReferenceChunk>(
|
||||
{} as IReferenceChunk,
|
||||
);
|
||||
const [documentId, setDocumentId] = useState<string>('');
|
||||
|
||||
const clickDocumentButton = useCallback(
|
||||
(documentId: string, chunk: IChunk) => {
|
||||
(documentId: string, chunk: IReferenceChunk) => {
|
||||
showModal();
|
||||
setSelectedChunk(chunk);
|
||||
setDocumentId(documentId);
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import { IModalProps } from '@/interfaces/common';
|
||||
import { IReferenceChunk } from '@/interfaces/database/chat';
|
||||
import { IChunk } from '@/interfaces/database/knowledge';
|
||||
import { Drawer } from 'antd';
|
||||
import DocumentPreviewer from '../pdf-previewer';
|
||||
|
||||
interface IProps extends IModalProps<any> {
|
||||
documentId: string;
|
||||
chunk: IChunk;
|
||||
chunk: IChunk | IReferenceChunk;
|
||||
}
|
||||
|
||||
export const PdfDrawer = ({
|
||||
|
||||
Reference in New Issue
Block a user