23 lines
679 B
TypeScript
23 lines
679 B
TypeScript
|
import '/styles/globals.css'
|
||
|
import type { ReactElement, ReactNode } from 'react'
|
||
|
import Layout from '../components/layout'
|
||
|
import type { NextPage } from 'next'
|
||
|
import { AppProps } from 'next/app';
|
||
|
|
||
|
|
||
|
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
|
||
|
getLayout?: (page: ReactElement) => ReactNode
|
||
|
}
|
||
|
|
||
|
export type AppPropsWithLayout = AppProps & {
|
||
|
Component: NextPageWithLayout
|
||
|
}
|
||
|
|
||
|
export default function Website({ Component, pageProps }: AppPropsWithLayout) {
|
||
|
// Use the layout defined at the page level, if available
|
||
|
const getLayout = Component.getLayout ?? ((page) => (
|
||
|
<Layout>{page}</Layout>))
|
||
|
|
||
|
return getLayout(<Component {...pageProps} />)
|
||
|
}
|