mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
16 lines
460 B
TypeScript
16 lines
460 B
TypeScript
import { useRouter } from "next/router";
|
|
import { handleUseParams, IRouterProvider } from "@refinedev/core";
|
|
|
|
import { handleRefineParams } from "./../legacy-common/handle-refine-params";
|
|
|
|
export const useParams: IRouterProvider["useParams"] = <Params>() => {
|
|
const router = useRouter();
|
|
|
|
const { query } = router;
|
|
const { refine } = query;
|
|
return {
|
|
...handleRefineParams(refine),
|
|
...handleUseParams(query),
|
|
} as Params;
|
|
};
|