import { AppProps } from 'next/app'
import { ApolloProvider } from '@apollo/client'

import client from '../src/lib/apollo'
import { UserProvider } from '../src/user/hooks'
import { Page } from '../src/app'

const MyApp = ({ Component, pageProps }: AppProps) => {
  return (
    <ApolloProvider client={client}>
      <UserProvider>
        <Page>
          <Component {...pageProps} />
        </Page>
      </UserProvider>
    </ApolloProvider>
  )
}

export default MyApp
