diff --git a/src/app/(main)/console/TestConsole.js b/src/app/(main)/console/TestConsole.js index 1ae3eaf1..b88bfd77 100644 --- a/src/app/(main)/console/TestConsole.js +++ b/src/app/(main)/console/TestConsole.js @@ -7,19 +7,15 @@ import WebsiteChart from '../../(main)/websites/[id]/WebsiteChart'; import useApi from 'components/hooks/useApi'; import Head from 'next/head'; import Link from 'next/link'; -import { useRouter } from 'next/navigation'; +import useNavigation from 'components/hooks/useNavigation'; import Script from 'next/script'; import { Button } from 'react-basics'; import styles from './TestConsole.module.css'; -export function TestConsole() { +export function TestConsole({ websiteId }) { const { get, useQuery } = useApi(); const { data, isLoading, error } = useQuery(['websites:me'], () => get('/me/websites')); - const router = useRouter(); - const { - basePath, - query: { id }, - } = router; + const { router } = useNavigation(); function handleChange(value) { router.push(`/console/${value}`); @@ -72,7 +68,6 @@ export function TestConsole() { return null; } - const [websiteId] = id || []; const website = data?.data.find(({ id }) => websiteId === id); return ( @@ -87,8 +82,8 @@ export function TestConsole() { <>