1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-10-16 15:07:27 +00:00
festa/pages/500.tsx

39 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-06-11 03:08:49 +00:00
import { NextPage, NextPageContext } from "next";
2022-06-05 15:35:35 +00:00
import { useTranslation } from "next-i18next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
2022-06-11 03:08:49 +00:00
import { ErrorBlock } from "../components/generic/errors/renderers";
import { ViewNotice } from "../components/generic/views/notice";
import { Postcard } from "../components/postcard/changer";
2022-06-05 15:35:35 +00:00
import errorPostcard from "../public/postcards/markus-spiske-iar-afB0QQw-unsplash-red.jpg"
export async function getStaticProps(context: NextPageContext) {
return {
props: {
...(await serverSideTranslations(context.locale ?? "it-IT", ["common"]))
}
}
}
2022-06-11 03:08:49 +00:00
const Page500: NextPage = (props) => {
2022-06-09 21:43:38 +00:00
const { t } = useTranslation()
2022-06-05 15:35:35 +00:00
return <>
2022-06-11 03:08:49 +00:00
<Postcard
src={errorPostcard}
/>
2022-06-09 21:43:38 +00:00
<ViewNotice
2022-06-11 03:08:49 +00:00
notice={<>
2022-06-05 15:35:35 +00:00
<ErrorBlock
text={t("internalServerError")}
error={new Error("HTTP 500 (Internal server error)")}
/>
2022-06-11 03:08:49 +00:00
</>}
2022-06-05 15:35:35 +00:00
/>
</>
2022-06-11 03:08:49 +00:00
}
export default Page500