Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Commit

Permalink
#649 add pages 404.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
kodsurfer committed Aug 20, 2024
1 parent f893fff commit 8a2289e
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import Link from 'next/link';
import Image from 'next/image';
import { useTranslation } from 'next-i18next';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import LanguageMarkup from '../components/LanguageMarkup';
import { GetStaticProps } from 'next';
import React from 'react';

interface FourOhFourProps {
languageMarkup: {
awailableLocales: string[];
defaultLocale: string;
};
}

const FourOhFour: React.FC<FourOhFourProps> = ({ languageMarkup }) => {
const { t } = useTranslation('404');

return (
<>
<LanguageMarkup languageMarkup={languageMarkup} />
<div className="container vh-100">
<div className="d-flex justify-content-center align-items-center h-100">
<div className="d-flex">
<div className="d-flex align-items-center flex-shrink-0 me-3">
<Image width="32" height="32" alt="Hexlet logo" src="/images/hexlet_logo.png" />
</div>
<div className="vr"></div>
<div className="ms-3">
<div className="lead">404 - {t('page.message')}</div>
<div>
<small>
{t('page.linkPrefix')}
{' '}
<Link href="/">
<a className="">
<ins>{t('page.link')}</ins>
</a>
</Link>
</small>
</div>
</div>
</div>
</div>
</div>
</>
);
};

export const getStaticProps: GetStaticProps = async ({ locale, locales, defaultLocale }) => ({
props: {
languageMarkup: {
awailableLocales: locales,
defaultLocale,
},
...await serverSideTranslations(locale, ['404']),
},
});

export default FourOhFour;

0 comments on commit 8a2289e

Please sign in to comment.