aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/404.tsx
blob: 5ba7b958ebc845fc1eceba9df27a6c1a327e9c18 (plain)
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
52
53
54
import { getLayout } from '@components/Layouts/Layout';
import PostHeader from '@components/PostHeader/PostHeader';
import { seo } from '@config/seo';
import { t, Trans } from '@lingui/macro';
import { NextPageWithLayout } from '@ts/types/app';
import { defaultLocale, loadTranslation } from '@utils/helpers/i18n';
import { GetStaticProps, GetStaticPropsContext } from 'next';
import Head from 'next/head';
import Link from 'next/link';
import styles from '@styles/pages/Page.module.scss';

const error404: NextPageWithLayout = () => {
  return (
    <>
      <Head>
        <title>{seo.error404.title}</title>
        <meta name="description" content={seo.error404.description} />
      </Head>
      <div className={`${styles.article} ${styles['article--no-comments']}`}>
        <PostHeader title={t`Page not found`} />
        <div className={styles.body}>
          <Trans>
            Sorry, it seems that the page you are looking for does not exist.
          </Trans>{' '}
          <Trans>
            If you think this path should work, feel free to{' '}
            <Link href="/contact/">contact me</Link> with the necessary
            information so that I can fix the problem.
          </Trans>
        </div>
      </div>
    </>
  );
};

error404.getLayout = getLayout;

export const getStaticProps: GetStaticProps = async (
  context: GetStaticPropsContext
) => {
  const breadcrumbTitle = t`Error`;
  const { locale } = context;
  const translation = await loadTranslation(locale || defaultLocale);

  return {
    props: {
      breadcrumbTitle,
      locale,
      translation,
    },
  };
};

export default error404;