Files
NotionNext/pages/404.js
2024-11-18 18:10:18 +08:00

25 lines
610 B
JavaScript

import { siteConfig } from '@/lib/config'
import { getGlobalData } from '@/lib/db/getSiteData'
import { DynamicLayout } from '@/themes/theme'
import { useRouter } from 'next/router'
/**
* 404
* @param {*} props
* @returns
*/
const NoFound = props => {
const router = useRouter()
const theme = siteConfig('THEME', BLOG.THEME, props.NOTION_CONFIG)
return <DynamicLayout theme={theme} router={router} {...props} />
}
export async function getStaticProps(req) {
const { locale } = req
const props = (await getGlobalData({ from: '404', locale })) || {}
return { props }
}
export default NoFound