commerce/pages/404.tsx
lytrankieio123 83c9e61519 🔧 config: global theme
:%s
2021-08-20 14:49:41 +07:00

32 lines
699 B
TypeScript

import type { GetStaticPropsContext } from 'next'
import commerce from '@lib/api/commerce'
import { Layout } from '@components/common'
export async function getStaticProps({
preview,
locale,
locales,
}: GetStaticPropsContext) {
const config = { locale, locales }
const { pages } = await commerce.getAllPages({ config, preview })
const { categories, brands } = await commerce.getSiteInfo({ config, preview })
return {
props: {
pages,
categories,
brands,
},
revalidate: 200,
}
}
export default function NotFound() {
return (
<div>
The requested page doesn't exist or you don't have access to it.
</div>
)
}
NotFound.Layout = Layout