import HightLightMarkdown from '@/components/highlight-markdown'; import { ImageWithPopover } from '@/components/image'; import IndentedTree from '@/components/indented-tree/indented-tree'; import { useSelectTestingResult } from '@/hooks/knowledge-hooks'; import { IReference } from '@/interfaces/database/chat'; import { Card, Divider, Flex, Input, Layout, List, Skeleton, Space, Tag, } from 'antd'; import { useState } from 'react'; import MarkdownContent from '../chat/markdown-content'; import { useFetchBackgroundImage, useSendQuestion } from './hooks'; import SearchSidebar from './sidebar'; import PdfDrawer from '@/components/pdf-drawer'; import { useClickDrawer } from '@/components/pdf-drawer/hooks'; import RetrievalDocuments from '@/components/retrieval-documents'; import { useTranslation } from 'react-i18next'; import styles from './index.less'; const { Content } = Layout; const { Search } = Input; const SearchPage = () => { const { t } = useTranslation(); const [checkedList, setCheckedList] = useState([]); const list = useSelectTestingResult(); // const appConf = useFetchAppConf(); const { sendQuestion, handleClickRelatedQuestion, handleSearchStrChange, handleTestChunk, answer, sendingLoading, relatedQuestions, mindMap, mindMapLoading, searchStr, loading, isFirstRender, } = useSendQuestion(checkedList); const { visible, hideModal, documentId, selectedChunk, clickDocumentButton } = useClickDrawer(); const imgUrl = useFetchBackgroundImage(); const InputSearch = ( ); return ( <> {isFirstRender ? ( {/* {appConf.appName} */} {InputSearch} ) : (
{InputSearch} {answer.answer && (
)} {list.chunks.length > 0 && ( ( {item.highlight} )} /> )} {relatedQuestions?.length > 0 && ( {relatedQuestions?.map((x, idx) => ( {x} ))} )}
{mindMapLoading ? ( ) : ( )}
)}
); }; export default SearchPage;