ragflow/web/src/hooks/logic-hooks/navigate-hooks.ts
balibabu 84afb4259c
Feat: Bind the route to the navigation bar in the head #3221 (#3863)
### What problem does this PR solve?
Feat: Bind the route to the navigation bar in the head #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2024-12-04 19:10:08 +08:00

22 lines
546 B
TypeScript

import { Routes } from '@/routes';
import { useCallback } from 'react';
import { useNavigate } from 'umi';
export const useNavigatePage = () => {
const navigate = useNavigate();
const navigateToDatasetList = useCallback(() => {
navigate(Routes.Datasets);
}, [navigate]);
const navigateToDataset = useCallback(() => {
navigate(Routes.Dataset);
}, [navigate]);
const navigateToHome = useCallback(() => {
navigate(Routes.Home);
}, [navigate]);
return { navigateToDatasetList, navigateToDataset, navigateToHome };
};