mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: use useRouter instead of location
This commit is contained in:
1 parent
cced57b22e
commit
ebbcdc2089
1 file changed
+3
-1
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useRouter } from 'next/router';
|
||||
import { ReactNode } from 'react';
|
||||
import { TOOLS } from '../../constants/tools';
|
||||
import { theme } from '../../stitches.config';
|
||||
@@ -9,7 +10,8 @@ interface ToolsLayoutProps {
|
||||
}
|
||||
|
||||
export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
const toolId = location.pathname.split('/').at(-1);
|
||||
const router = useRouter();
|
||||
const toolId = router.pathname.split('/').at(-1);
|
||||
const tool = TOOLS.find((tool) => tool.id === toolId);
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user