This repository has been archived by the owner on Dec 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kodsurfer
committed
Aug 20, 2024
1 parent
f893fff
commit 8a2289e
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |