mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
remove custom error page
This commit is contained in:
parent
67aa1c1f23
commit
2ef4a7376e
1 changed files with 0 additions and 43 deletions
|
@ -1,43 +0,0 @@
|
|||
import { GetServerSideProps } from "next";
|
||||
import FadeIn from "react-fade-in";
|
||||
type ErrorPage = {
|
||||
statusCode: number;
|
||||
message: string;
|
||||
};
|
||||
|
||||
export default function ({ statusCode, message }: ErrorPage) {
|
||||
return (
|
||||
<FadeIn>
|
||||
<div className="flex flex-col justify-center items-center h-[90vh]">
|
||||
<div>
|
||||
<h1 className="font-semibold text-2xl inline-block mr-[1.7rem] pr-[1.5rem] border-r-[1px] border-white">
|
||||
{statusCode}
|
||||
</h1>
|
||||
<div className="inline-block text-left">
|
||||
<h2 className="text-lg font-extralight">{message}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</FadeIn>
|
||||
);
|
||||
}
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async (props) => {
|
||||
const { res, err }: any = props;
|
||||
|
||||
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
|
||||
|
||||
let entries: any = {
|
||||
404: "Az oldal nem található",
|
||||
400: "Érvénytelen kérelem",
|
||||
500: "Szerveroldali hiba",
|
||||
};
|
||||
const message = entries[statusCode];
|
||||
|
||||
return {
|
||||
props: {
|
||||
statusCode,
|
||||
message,
|
||||
},
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue