1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 07:04:22 +00:00
festa/pages/404.tsx

44 lines
1.3 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-08 02:52:41 +00:00
import { default as Link } from "next/link";
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 Page404: 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-05 15:43:31 +00:00
notice={<>
2022-06-05 15:35:35 +00:00
<ErrorBlock
text={t("notFoundError")}
error={new Error("HTTP 404 (Not found)")}
/>
2022-06-05 15:43:31 +00:00
<p>
2022-06-11 03:08:49 +00:00
<Link href="/"><a>
{t("notFoundBackHome")}
</a></Link>
2022-06-05 15:43:31 +00:00
</p>
</>}
2022-06-05 15:35:35 +00:00
/>
</>
2022-06-11 03:08:49 +00:00
}
export default Page404