mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix: fix dataset-page's bugs (#8786)
### What problem does this PR solve? fix dataset-page's bugs,Input component supports icon, added Radio component, and removed antd from chunk-result-bar page [#3221 ](https://github.com/infiniflow/ragflow/issues/3221) ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -37,20 +37,6 @@ export const useSetSelectedRecord = <T = IKnowledgeFile>() => {
|
||||
return { currentRecord, setRecord };
|
||||
};
|
||||
|
||||
export const useHandleSearchChange = () => {
|
||||
const [searchString, setSearchString] = useState('');
|
||||
|
||||
const handleInputChange = useCallback(
|
||||
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||
const value = e.target.value;
|
||||
setSearchString(value);
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
return { handleInputChange, searchString };
|
||||
};
|
||||
|
||||
export const useChangeLanguage = () => {
|
||||
const { i18n } = useTranslation();
|
||||
const { saveSetting } = useSaveSetting();
|
||||
@ -82,9 +68,12 @@ export const useGetPaginationWithRouter = () => {
|
||||
|
||||
const setCurrentPagination = useCallback(
|
||||
(pagination: { page: number; pageSize?: number }) => {
|
||||
if (pagination.pageSize !== pageSize) {
|
||||
pagination.page = 1; // Reset to first page if pageSize changes
|
||||
}
|
||||
setPaginationParams(pagination.page, pagination.pageSize);
|
||||
},
|
||||
[setPaginationParams],
|
||||
[setPaginationParams, pageSize],
|
||||
);
|
||||
|
||||
const pagination: PaginationProps = useMemo(() => {
|
||||
@ -106,6 +95,21 @@ export const useGetPaginationWithRouter = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const useHandleSearchChange = () => {
|
||||
const [searchString, setSearchString] = useState('');
|
||||
const { setPagination } = useGetPaginationWithRouter();
|
||||
const handleInputChange = useCallback(
|
||||
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||
const value = e.target.value;
|
||||
setSearchString(value);
|
||||
setPagination({ page: 1 });
|
||||
},
|
||||
[setPagination],
|
||||
);
|
||||
|
||||
return { handleInputChange, searchString };
|
||||
};
|
||||
|
||||
export const useGetPagination = () => {
|
||||
const [pagination, setPagination] = useState({ page: 1, pageSize: 10 });
|
||||
const { t } = useTranslate('common');
|
||||
|
||||
Reference in New Issue
Block a user