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