'use client'
import { useSearchParams } from 'next/navigation';
import router from '../_router/router';
import { Box } from '@mantine/core';


function Page() {
  const { page } = router.routes.dashboard.parse(useSearchParams())
  switch (page) {
    case "1":
      return <Page1 />
    case "2":
      return <Page2 />
    case "3":
      return <Page3 />
    default:
      return <Page1 />
  }
}

const Page1 = () => {
  return <Box h={200} bg="red">Page 1</Box>
}

const Page2 = () => {
  return <Box h={200} bg="blue">Page 2</Box>
}

const Page3 = () => {
  return <Box h={200} bg="green">Page 3</Box>
}

export default Page;
