-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path404.tsx
41 lines (33 loc) · 1.17 KB
/
404.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {GetStaticProps} from 'next'
import {useTranslation} from 'next-i18next'
import {serverSideTranslations} from 'next-i18next/serverSideTranslations'
import {NextSeo} from 'next-seo'
import {FC} from 'react'
import {Footer} from '@/components/Footer'
import {Navigation} from '@/components/Navigation'
interface Props {
locale: string
}
const NotFound: FC<Props> = () => {
const {t} = useTranslation()
return (
<div>
<NextSeo title="404" />
<Navigation />
<main className="max-w-4xl px-4 mx-auto mt-4 space-y-8 sm:space-y-12 sm:px-8 sm:mt-8">
<div className="space-y-2" style={{minHeight: '50vh'}}>
<span className="text-lg font-medium text-100 sm:text-xl">404</span>
<h1 className="text-2xl font-bold sm:text-5xl">{t('404:not_found')}</h1>
</div>
</main>
<Footer />
</div>
)
}
export const getStaticProps: GetStaticProps<Props> = async context => {
const namespaces = ['header', 'footer', '404', 'common']
const locale = context.locale || 'en'
const translations = await serverSideTranslations(locale || 'en', namespaces)
return {props: {...translations, locale}}
}
export default NotFound