import React from 'react';
import type { ReactElement } from 'react';
import { useRouter } from 'next/router';
import GeoSeekProWorkspace from '../../components/GeoSeek/GeoSeekProWorkspace';
import LayoutAuthenticated from '../../layouts/Authenticated';

const GeoSeekModulePage = () => {
  const router = useRouter();
  const moduleKey = Array.isArray(router.query.module) ? router.query.module[0] : router.query.module;

  return <GeoSeekProWorkspace moduleKey={moduleKey || 'home'} />;
};

GeoSeekModulePage.getLayout = function getLayout(page: ReactElement) {
  return <LayoutAuthenticated>{page}</LayoutAuthenticated>;
};

export default GeoSeekModulePage;
