import { NextPage, NextPageContext } from "next"; import Link from "next/link"; import styles from "../styles/Errorpage.module.css"; const Error: NextPage<{ statusCode?: number }> = ({ statusCode }) => { const svg = ` ${statusCode ? statusCode : "???"} `; return
{ statusCode === 404 ? "The site you requested could not be found." : "An error occurred." }
> Back to the main page <
; }; Error.getInitialProps = ({ res, err }: NextPageContext) => { const statusCode = res ? res.statusCode : err ? err.statusCode : 404; return { statusCode }; }; export default Error;