mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 03:45:06 +03:00
18 lines
555 B
TypeScript
18 lines
555 B
TypeScript
import { NextPage } from 'next'
|
|
import { AppProps } from 'next/app'
|
|
import { ComponentType, ReactElement, ReactNode } from 'react'
|
|
|
|
export type AppPropsWithLayout = AppProps & {
|
|
Component: NextPageWithLayout
|
|
}
|
|
|
|
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
|
|
getLayout?: (page: ReactElement) => ReactNode
|
|
}
|
|
|
|
export function isNextPageWithLayout<T>(
|
|
Component: ComponentType<T> | NextPageWithLayout<T, T>
|
|
): Component is NextPageWithLayout<T, T> {
|
|
return 'getLayout' in Component && typeof Component.getLayout === 'function'
|
|
}
|