mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2025-02-15 05:39:15 +01:00
fix
This commit is contained in:
parent
3e8dfabcc4
commit
50df2a4739
3 changed files with 67 additions and 7 deletions
60
src/pages/_error.tsx
Normal file
60
src/pages/_error.tsx
Normal file
|
@ -0,0 +1,60 @@
|
|||
import { Footer } from '@/components/Footer'
|
||||
import { Button } from '@nextui-org/button'
|
||||
import Link from 'next/link'
|
||||
import type { GetServerSideProps, GetServerSidePropsContext } from 'next'
|
||||
|
||||
interface ErrorProps {
|
||||
statusCode: number
|
||||
}
|
||||
|
||||
const ErrorPage: React.FC<ErrorProps> = ({ statusCode }) => {
|
||||
return (
|
||||
<>
|
||||
<main className='dark:bg-[#121212] text-foreground bg-background py-5'>
|
||||
<h1 className='text-7xl font-bold text-blue-400 text-center mt-16'>
|
||||
{statusCode}
|
||||
</h1>
|
||||
<div className='flex min-h-screen flex-col items-center justify-between'>
|
||||
<div className='container mx-auto'>
|
||||
<div className='flex flex-col items-center justify-center'>
|
||||
<div className='mt-5 mb-3'>
|
||||
<div className='text-2xl font-semibold text-gray-600'>
|
||||
{statusCode == 404 ? (
|
||||
<>
|
||||
<p className='mt-2'>Az keresett oldal nem található.</p>
|
||||
<p className='mt-8 text-center'>
|
||||
<Button color='primary'>
|
||||
<Link href='/'>{'Vissza'}</Link>
|
||||
</Button>
|
||||
</p>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<p className='mt-2'>Váratlan hiba történt.</p>
|
||||
<p className='mt-8 text-center'>
|
||||
<Button color='primary'>
|
||||
<Link href='/'>{'Vissza'}</Link>
|
||||
</Button>
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Footer />
|
||||
</main>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export const getServerSideProps: GetServerSideProps<ErrorProps> = async (
|
||||
context: GetServerSidePropsContext
|
||||
) => ({
|
||||
props: {
|
||||
statusCode: context.res ? context.res.statusCode : 404,
|
||||
},
|
||||
})
|
||||
|
||||
export default ErrorPage
|
Loading…
Add table
Add a link
Reference in a new issue