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

50 lines
1.3 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 { applyCustomAppProps } from "./_app";
2022-01-01 19:04:48 +00:00
import Head from "next/head";
import { getWebsiteInterface } from "graphql/operations";
import { GetStaticProps } from "next";
import { GetWebsiteInterfaceQuery } from "graphql/operations-types";
import MainPanel from "components/Panels/MainPanel";
2021-12-23 22:07:20 +00:00
applyCustomAppProps(FourOhFour, {
useSubPanel: false,
useContentPanel: true,
});
type Props = {
langui: GetWebsiteInterfaceQuery;
};
export default function FourOhFour(props: Props): JSX.Element {
const langui = props.langui.websiteInterfaces.data[0].attributes;
2021-12-23 22:07:20 +00:00
return (
2022-01-01 19:04:48 +00:00
<>
<Head>
<title>Accord&rsquo;s Library - 404</title>
</Head>
<MainPanel langui={langui} />
2022-01-01 19:04:48 +00:00
<ContentPanel>
<h1>404 - Page Not Found</h1>
<Link href="/">
<a>Go back home</a>
</Link>
</ContentPanel>
</>
2021-12-23 22:07:20 +00:00
);
}
export const getStaticProps: GetStaticProps = async (context) => {
if (context.locale) {
const props: Props = {
langui: await getWebsiteInterface({
language_code: context.locale,
}),
};
return {
props: props,
};
}
return { props: {} };
};