mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
9 lines
295 B
TypeScript
9 lines
295 B
TypeScript
import { useRouteMatch } from 'react-router';
|
|
import { useRouter } from 'next/router';
|
|
import { CONFIG } from '~/utils/config';
|
|
|
|
export const useNodePageParams = () => {
|
|
return CONFIG.isNextEnvironment
|
|
? (useRouter().query.id as string)
|
|
: useRouteMatch<{ id: string }>().params.id;
|
|
};
|