mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
28 lines
623 B
JavaScript
28 lines
623 B
JavaScript
import { siteConfig } from '@/lib/config'
|
|
import { getGlobalData } from '@/lib/db/getSiteData'
|
|
import { getLayoutByTheme } from '@/themes/theme'
|
|
import { useRouter } from 'next/router'
|
|
|
|
/**
|
|
* 404
|
|
* @param {*} props
|
|
* @returns
|
|
*/
|
|
const NoFound = props => {
|
|
// 根据页面路径加载不同Layout文件
|
|
const Layout = getLayoutByTheme({
|
|
theme: siteConfig('THEME'),
|
|
router: useRouter()
|
|
})
|
|
return <Layout {...props} />
|
|
}
|
|
|
|
export async function getStaticProps(req) {
|
|
const { locale } = req
|
|
|
|
const props = (await getGlobalData({ from: '404', locale })) || {}
|
|
return { props }
|
|
}
|
|
|
|
export default NoFound
|