ragflow/web/src/hooks/logic-hooks/navigate-hooks.ts
balibabu e8b4e8b3d7
Feat: Bind event to the theme Switch #3221 (#4067)
### What problem does this PR solve?

Feat: Bind event to  the theme Switch #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2024-12-17 16:32:17 +08:00

31 lines
688 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]);
const navigateToProfile = useCallback(() => {
navigate(Routes.ProfileSetting);
}, [navigate]);
return {
navigateToDatasetList,
navigateToDataset,
navigateToHome,
navigateToProfile,
};
};