-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy path_error.tsx
More file actions
45 lines (42 loc) · 1.59 KB
/
_error.tsx
File metadata and controls
45 lines (42 loc) · 1.59 KB
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
import Link from '@/components/Link'
import { PageSEO } from '@/components/SEO'
import { NextPageContext } from 'next'
type ErrorProps = {
statusCode?: number
}
export default function Error({ statusCode }: ErrorProps) {
return (
<>
<PageSEO
title="Something Went Wrong"
description="An unexpected error occurred"
/>
<div className="flex flex-col items-start justify-start md:mt-24 md:flex-row md:items-center md:justify-center md:space-x-6">
<div className="space-x-2 pb-8 pt-6 md:space-y-5">
<h1 className="text-6xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 md:border-r-2 md:px-6 md:text-8xl md:leading-14">
{statusCode || 500}
</h1>
</div>
<div className="max-w-md">
<p className="mb-4 text-xl font-bold leading-normal md:text-2xl">
Something went wrong.
</p>
<p className="mb-8">
An unexpected error occurred. Please try again or head back to the
<
3F11
/div> homepage.
</p>
<Link
href="/"
className="focus:shadow-outline-orange inline rounded-lg border border-transparent bg-orange-600 px-4 py-2 text-sm font-medium leading-5 text-white shadow transition-colors duration-150 hover:bg-orange-700 focus:outline-none dark:hover:bg-orange-500"
>
Back to homepage
</Link>
</div>
</div>
</>
)
}
Error.getInitialProps = ({ res, err }: NextPageContext) => {
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
return { statusCode }
}