accords-library.com/src/pages/404.tsx

38 lines
1.1 KiB
TypeScript
Raw Normal View History

2021-12-23 22:07:20 +00:00
import Link from "next/link";
import ContentPanel from "components/Panels/ContentPanel";
import { getWebsiteInterface } from "graphql/operations";
import { GetStaticProps } from "next";
import { GetWebsiteInterfaceQuery } from "graphql/operations-types";
import AppLayout from "components/AppLayout";
2021-12-23 22:07:20 +00:00
type FourOhFourProps = {
langui: GetWebsiteInterfaceQuery;
};
export default function FourOhFour(props: FourOhFourProps): JSX.Element {
const langui = props.langui.websiteInterfaces.data[0].attributes;
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
}
export const getStaticProps: GetStaticProps = async (context) => {
if (context.locale) {
const props: FourOhFourProps = {
langui: await getWebsiteInterface({
language_code: context.locale,
}),
};
return {
props: props,
};
}
return { props: {} };
};