1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-12-08 00:44:30 +01:00
.profile/pages/404.tsx

35 lines
983 B
TypeScript
Raw Normal View History

2021-12-04 15:52:51 +01:00
import { GetStaticProps, NextPage } from 'next'
2021-04-18 01:56:23 +02:00
import useTranslation from 'next-translate/useTranslation'
import { ErrorPage } from 'components/ErrorPage'
2021-04-18 23:13:54 +02:00
import { Head } from 'components/Head'
2021-07-27 13:36:35 +02:00
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
2021-04-18 01:56:23 +02:00
interface Error404Props extends FooterProps {}
2021-12-04 15:52:51 +01:00
const Error404: NextPage<Error404Props> = (props) => {
2021-04-18 01:56:23 +02:00
const { t } = useTranslation()
const { version } = props
2021-04-18 01:56:23 +02:00
return (
<>
<Head title='404 | Divlo' />
2021-07-27 13:36:35 +02:00
2022-07-28 23:01:19 +02:00
<Header showLanguage />
2021-07-27 13:36:35 +02:00
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<ErrorPage statusCode={404} message={t('errors:not-found')} />
2021-07-27 13:36:35 +02:00
</main>
<Footer version={version} />
2021-04-18 01:56:23 +02:00
</>
)
}
export const getStaticProps: GetStaticProps<Error404Props> = async () => {
2021-08-16 15:31:35 +02:00
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version } }
2021-04-18 01:56:23 +02:00
}
export default Error404