mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-03 11:05:30 +08:00
### What problem does this PR solve? Feat: Add dataset sidebar #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
16
web/src/pages/dataset/sidebar/hooks.tsx
Normal file
16
web/src/pages/dataset/sidebar/hooks.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
import { DatasetBaseKey, KnowledgeRouteKey } from '@/constants/knowledge';
|
||||
import { useCallback } from 'react';
|
||||
import { useNavigate } from 'umi';
|
||||
|
||||
export const useHandleMenuClick = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleMenuClick = useCallback(
|
||||
(key: KnowledgeRouteKey) => () => {
|
||||
navigate(`/${DatasetBaseKey}/${key}`);
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
|
||||
return { handleMenuClick };
|
||||
};
|
||||
Reference in New Issue
Block a user