mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-05 18:15:06 +08:00
### What problem does this PR solve? feat(search): Added app embedding functionality and optimized search page #3221 - Added an Embed App button and related functionality - Optimized the layout and interaction of the search settings interface - Adjusted the search result display method - Refactored some code to support new features ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
35
web/src/pages/next-search/share/index.tsx
Normal file
35
web/src/pages/next-search/share/index.tsx
Normal file
@ -0,0 +1,35 @@
|
||||
import i18n from '@/locales/config';
|
||||
import { useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
ISearchAppDetailProps,
|
||||
useFetchSearchDetail,
|
||||
} from '../../next-searches/hooks';
|
||||
import { useGetSharedSearchParams, useSearching } from '../hooks';
|
||||
import '../index.less';
|
||||
import SearchingView from '../search-view';
|
||||
export default function SearchingPage() {
|
||||
const { tenantId, locale } = useGetSharedSearchParams();
|
||||
const {
|
||||
data: searchData = {
|
||||
search_config: { kb_ids: [] },
|
||||
} as unknown as ISearchAppDetailProps,
|
||||
} = useFetchSearchDetail(tenantId as string);
|
||||
const searchingParam = useSearching({
|
||||
data: searchData,
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
|
||||
// useEffect(() => {
|
||||
// if (locale) {
|
||||
// i18n.changeLanguage(locale);
|
||||
// }
|
||||
// }, [locale, i18n]);
|
||||
useEffect(() => {
|
||||
console.log('locale', locale, i18n.language);
|
||||
if (locale && i18n.language !== locale) {
|
||||
i18n.changeLanguage(locale);
|
||||
}
|
||||
}, [locale]);
|
||||
return <SearchingView {...searchingParam} searchData={searchData} t={t} />;
|
||||
}
|
||||
Reference in New Issue
Block a user