2021-12-23 22:07:20 +00:00
|
|
|
import Link from "next/link";
|
|
|
|
import ContentPanel from "components/Panels/ContentPanel";
|
2022-02-12 10:02:22 +00:00
|
|
|
import { getWebsiteInterface } from "graphql/operations";
|
|
|
|
import { GetStaticProps } from "next";
|
|
|
|
import { GetWebsiteInterfaceQuery } from "graphql/operations-types";
|
2022-02-15 14:50:51 +00:00
|
|
|
import AppLayout from "components/AppLayout";
|
2021-12-23 22:07:20 +00:00
|
|
|
|
2022-02-15 14:50:51 +00:00
|
|
|
type FourOhFourProps = {
|
2022-02-12 10:02:22 +00:00
|
|
|
langui: GetWebsiteInterfaceQuery;
|
|
|
|
};
|
|
|
|
|
2022-02-15 14:50:51 +00:00
|
|
|
export default function FourOhFour(props: FourOhFourProps): JSX.Element {
|
2022-02-12 10:02:22 +00:00
|
|
|
const langui = props.langui.websiteInterfaces.data[0].attributes;
|
2022-02-15 14:50:51 +00:00
|
|
|
const contentPanel = (
|
|
|
|
<ContentPanel>
|
|
|
|
<h1>404 - Page Not Found</h1>
|
|
|
|
<Link href="/">
|
|
|
|
<a>Go back home</a>
|
|
|
|
</Link>
|
|
|
|
</ContentPanel>
|
2021-12-23 22:07:20 +00:00
|
|
|
);
|
2022-02-24 03:50:00 +00:00
|
|
|
return <AppLayout navTitle="404" langui={langui} contentPanel={contentPanel} />;
|
2021-12-23 22:07:20 +00:00
|
|
|
}
|
2022-02-12 10:02:22 +00:00
|
|
|
|
|
|
|
export const getStaticProps: GetStaticProps = async (context) => {
|
|
|
|
if (context.locale) {
|
2022-02-15 14:50:51 +00:00
|
|
|
const props: FourOhFourProps = {
|
2022-02-12 10:02:22 +00:00
|
|
|
langui: await getWebsiteInterface({
|
|
|
|
language_code: context.locale,
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
return {
|
|
|
|
props: props,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return { props: {} };
|
|
|
|
};
|