mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-22 15:10:29 +00:00
27 lines
612 B
TypeScript
27 lines
612 B
TypeScript
import React from 'react'
|
|
import { domain } from 'lib/config'
|
|
import { resolveNotionPage } from 'lib/resolve-notion-page'
|
|
import { NotionPage } from 'components'
|
|
|
|
export const getStaticProps = async (context) => {
|
|
try {
|
|
const props = await resolveNotionPage(domain)
|
|
|
|
return { props, revalidate: 10 }
|
|
} catch (err) {
|
|
console.error('page error', domain, err)
|
|
|
|
return {
|
|
props: {
|
|
error: {
|
|
statusCode: err.statusCode || 500,
|
|
message: err.message
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
export default function NotionDomainPage(props) {
|
|
return <NotionPage {...props} />
|
|
}
|