import "../styles/globals.css"
import type { AppProps } from "next/app"
import type { ReactElement, ReactNode } from "react"
import type { NextPage } from "next"

export type NextPageWithLayout = NextPage & {
	getLayout?: (page: ReactElement) => ReactNode
}

type AppPropsWithLayout = AppProps & {
	Component: NextPageWithLayout
}

function MyApp({ Component, pageProps }: AppProps) {
	const getLayout = Component.getLayout ?? ((page) => page)
	return getLayout(<Component {...pageProps}/>)
}

export default MyApp
