Feat: Add an id to the dataset testing route #3221 (#4951)

### 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)
This commit is contained in:
balibabu
2025-02-14 10:43:59 +08:00
committed by GitHub
parent 042f4c90c6
commit dce7053c24
2 changed files with 6 additions and 5 deletions

View File

@ -1,15 +1,16 @@
import { Routes } from '@/routes';
import { useCallback } from 'react';
import { useNavigate } from 'umi';
import { useNavigate, useParams } from 'umi';
export const useHandleMenuClick = () => {
const navigate = useNavigate();
const { id } = useParams();
const handleMenuClick = useCallback(
(key: Routes) => () => {
navigate(`${Routes.DatasetBase}${key}`);
navigate(`${Routes.DatasetBase}${key}/${id}`);
},
[navigate],
[id, navigate],
);
return { handleMenuClick };