This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/components/ErrorPage.tsx

46 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

import useTranslation from "next-translate/useTranslation"
import Link from "next/link"
2021-10-24 05:48:06 +02:00
import type { FooterProps } from "./Footer"
import { Footer } from "./Footer"
import { Header } from "./Header"
2022-12-13 22:31:32 +01:00
export interface ErrorPageProps extends FooterProps {
2021-10-24 05:48:06 +02:00
statusCode: number
message: string
}
export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
2022-12-13 22:31:32 +01:00
const { message, statusCode, version } = props
2021-10-24 05:48:06 +02:00
const { t } = useTranslation()
return (
<>
<div className="flex h-screen flex-col pt-0">
2022-12-13 22:31:32 +01:00
<Header />
<main className="flex min-w-full flex-1 flex-col items-center justify-center">
<h1 className="my-6 text-4xl font-semibold">
{t("errors:error")}{" "}
2022-12-13 22:31:32 +01:00
<span
className="text-green-800 dark:text-green-400"
data-cy="status-code"
2022-12-13 22:31:32 +01:00
>
{statusCode}
</span>
</h1>
<p className="text-center text-lg">
{message}{" "}
2022-12-13 22:31:32 +01:00
<Link
href="/"
className="text-green-800 hover:underline dark:text-green-400"
2022-12-13 22:31:32 +01:00
>
{t("errors:return-to-home-page")}
2022-12-13 22:31:32 +01:00
</Link>
</p>
</main>
<Footer version={version} />
</div>
2021-10-24 05:48:06 +02:00
</>
)
}