import type { NextPage } from 'next'
import Head from 'next/head'
import { Home } from '../components/home/Home'
import { GroupProvider } from '../components/contexts/GroupProvider'
import { getServerSidePropsGroupProvider, PropsGroupProvider } from '../src/getServerSideProps'

const Page: NextPage<PropsGroupProvider> = ({ id, ...initial }) => {
  return (
    <GroupProvider id={id} initial={initial}>
      <Head>
        <title>Factorio Microservices</title>
        <meta name='description' content='Create Factorio microservices' />
        <link rel='icon' href='/favicon.ico' />
      </Head>
      <Home />
    </GroupProvider>
  )
}

export const getServerSideProps = getServerSidePropsGroupProvider

export default Page
