amalia/06-mar-26 #22

Merged
amaliadwiy merged 8 commits from amalia/06-mar-26 into join 2026-03-06 16:37:03 +08:00
9 changed files with 1188 additions and 0 deletions
Showing only changes of commit d401ebb208 - Show all commits

30
src/pages/_error.tsx Normal file
View File

@@ -0,0 +1,30 @@
import { NextPageContext } from "next";
function ErrorPage({ statusCode }: { statusCode?: number }) {
return (
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
minHeight: "100vh",
backgroundColor: "#252A2F",
color: "white",
fontFamily: "Lato, sans-serif",
}}
>
<h1 style={{ fontSize: 24, fontWeight: 700 }}>
{statusCode === 404
? "404 - Halaman Tidak Ditemukan"
: "Terjadi Kesalahan"}
</h1>
</div>
);
}
ErrorPage.getInitialProps = ({ res, err }: NextPageContext) => {
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
return { statusCode };
};
export default ErrorPage;