-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
1 changed file
with
27 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,27 @@ | ||
import MainContainer from '@/components/shared/MainContainer'; | ||
import { NextPageContext } from 'next'; | ||
import { useRouter } from 'next/router'; | ||
|
||
function Error({ statusCode }: { statusCode?: number }) { | ||
const router = useRouter(); | ||
return ( | ||
<MainContainer> | ||
<div className="flex items-center justify-center text-3xl font-extrabold"> | ||
{statusCode} 에러가 발생했습니다. | ||
</div> | ||
<div | ||
onClick={() => router.replace('/')} | ||
className="cursor-pointer mt-16 mx-auto rounded-lg w-[360px] h-12 bg-space-purple text-white text-xl font-semibold flex items-center justify-center"> | ||
홈으로 | ||
</div> | ||
</MainContainer> | ||
); | ||
} | ||
|
||
Error.getInitialProps = ({ res, err }: NextPageContext) => { | ||
const statusCode = res ? res.statusCode : err ? err.statusCode : 404; | ||
|
||
return { statusCode }; | ||
}; | ||
|
||
export default Error; |