import { PageOptions } from '@graphcommerce/framer-next-pages' import { SearchForm } from '@graphcommerce/magento-search' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { GetStaticProps, Separator } from '@graphcommerce/next-ui' import { Box, Container, Typography, Link } from '@material-ui/core' import PageLink from 'next/link' import React from 'react' import FullPageShell, { FullPageShellProps } from '../components/AppShell/FullPageShell' import { DefaultPageDocument, DefaultPageQuery } from '../components/GraphQL/DefaultPage.gql' import apolloClient from '../lib/apolloClient' export const config = { unstable_JsPreload: false } type Props = DefaultPageQuery type GetPageStaticProps = GetStaticProps function RouteNotFoundPage() { const links = [ Store home , Account , ] return ( <> Whoops our bad... We couldn't find the page you were looking for Or follow these links to get you back on track! {links.map((link, index) => ( // eslint-disable-next-line react/no-array-index-key {index > 0 && } {link} ))} ) } RouteNotFoundPage.pageOptions = { SharedComponent: FullPageShell, } as PageOptions export default RouteNotFoundPage export const getStaticProps: GetPageStaticProps = async ({ locale }) => { const client = apolloClient(locale, true) const staticClient = apolloClient(locale) const conf = client.query({ query: StoreConfigDocument }) const page = staticClient.query({ query: DefaultPageDocument, variables: { url: `/`, rootCategory: (await conf).data.storeConfig?.root_category_uid ?? '', }, }) return { props: { ...(await page).data, apolloState: await conf.then(() => client.cache.extract()), }, revalidate: 60 * 20, } }