mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-05 04:51:30 +01:00
Théo LUDWIG
6b29ce9b15
Improvements: - Hide switch theme input (ugly little white square) - i18n without subpath (e.g: /fr or /en), same url whatever the locale used
37 lines
907 B
TypeScript
37 lines
907 B
TypeScript
import Link from 'next/link'
|
|
|
|
import { getI18n } from '@/i18n/i18n.server'
|
|
|
|
export interface ErrorPageProps {
|
|
statusCode: number
|
|
message: string
|
|
}
|
|
|
|
export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
|
|
const { message, statusCode } = props
|
|
const i18n = getI18n()
|
|
|
|
return (
|
|
<main className='flex flex-col flex-1 items-center justify-center'>
|
|
<h1 className='my-6 text-4xl font-semibold'>
|
|
{i18n.translate('errors.error')}{' '}
|
|
<span
|
|
className='text-yellow dark:text-yellow-dark'
|
|
data-cy='status-code'
|
|
>
|
|
{statusCode}
|
|
</span>
|
|
</h1>
|
|
<p className='text-center text-lg'>
|
|
{message}{' '}
|
|
<Link
|
|
href='/'
|
|
className='text-yellow hover:underline dark:text-yellow-dark'
|
|
>
|
|
{i18n.translate('errors.return-to-home-page')}
|
|
</Link>
|
|
</p>
|
|
</main>
|
|
)
|
|
}
|