2022-09-04 20:40:58 +02:00
|
|
|
import type { 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'
|
2022-09-04 20:40:58 +02:00
|
|
|
import type { FooterProps } from 'components/Footer'
|
2021-04-18 01:56:23 +02:00
|
|
|
|
2022-03-24 18:57:27 +01:00
|
|
|
interface Error500Props extends FooterProps {}
|
2021-12-04 15:52:51 +01:00
|
|
|
|
|
|
|
const Error500: NextPage<Error500Props> = (props) => {
|
2021-04-18 01:56:23 +02:00
|
|
|
const { t } = useTranslation()
|
2022-03-24 18:57:27 +01:00
|
|
|
const { version } = props
|
2021-04-18 01:56:23 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2023-05-30 21:51:27 +02:00
|
|
|
<Head title='500 | Théo LUDWIG' />
|
2022-10-03 20:52:15 +02:00
|
|
|
<ErrorPage
|
|
|
|
statusCode={500}
|
|
|
|
message={t('errors:server-error')}
|
|
|
|
version={version}
|
|
|
|
/>
|
2021-04-18 01:56:23 +02:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-03-24 18:57:27 +01:00
|
|
|
export const getStaticProps: GetStaticProps<Error500Props> = async () => {
|
2021-08-16 15:31:35 +02:00
|
|
|
const { readPackage } = await import('read-pkg')
|
|
|
|
const { version } = await readPackage()
|
2022-03-24 18:57:27 +01:00
|
|
|
return { props: { version } }
|
2021-04-18 01:56:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Error500
|