mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 00:46:52 +08:00
### What problem does this PR solve? Feat: Add an id to the dataset testing route #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
18 lines
413 B
TypeScript
18 lines
413 B
TypeScript
import { Routes } from '@/routes';
|
|
import { useCallback } from 'react';
|
|
import { useNavigate, useParams } from 'umi';
|
|
|
|
export const useHandleMenuClick = () => {
|
|
const navigate = useNavigate();
|
|
const { id } = useParams();
|
|
|
|
const handleMenuClick = useCallback(
|
|
(key: Routes) => () => {
|
|
navigate(`${Routes.DatasetBase}${key}/${id}`);
|
|
},
|
|
[id, navigate],
|
|
);
|
|
|
|
return { handleMenuClick };
|
|
};
|