-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path404.tsx
51 lines (46 loc) · 1.65 KB
/
404.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Heading } from "@/components/global/Typography/Heading";
import { Preamble } from "@/components/global/Typography/Preamble";
import { Container } from "@/components/layout/Container";
import { SettingsContext } from "@/providers/SettingsProvider";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { FC, useContext, useEffect } from "react";
import { linkBase } from "@/utilities";
import { usePathname } from "next/navigation";
const NotFound: FC = () => {
const { t, lang } = useTranslation("pages");
const { setBreadcrumb } = useContext(SettingsContext);
const pathname = usePathname();
useEffect(() => {
setBreadcrumb &&
setBreadcrumb({
name: t("notfoundpage$heading"),
crumbs: [{ name: "start", link: { ...linkBase, link: "/" } }],
});
}, [pathname, setBreadcrumb]);
return (
<Container>
<Heading level={1} size={"lg"} className="mb-lg md:mb-xl">
{t("notfoundpage$heading")}
</Heading>
<Preamble className="max-w-md">{t("notfoundpage$body")}</Preamble>
<ul className="space-y-md py-xl">
<li>
<Link href={`/`} locale={lang} className="text-lg hover:no-underline">
{t("notfoundpage$startpage")}
</Link>
</li>
<li>
<Link
href={`/datasets?p=1&q=&s=2&t=20&f=&rt=dataset%24esterms_IndependentDataService%24esterms_ServedByDataService&c=false`}
locale={lang}
className="text-lg hover:no-underline"
>
{t("notfoundpage$search-data")}
</Link>
</li>
</ul>
</Container>
);
};
export default NotFound;