import React from 'react' import Head from 'next/head' export default class Error extends React.Component { static getInitialProps ({ res, xhr }) { const statusCode = res ? res.statusCode : (xhr ? xhr.status : null) return { statusCode } } render () { const { statusCode } = this.props const title = statusCode === 404 ? 'This page could not be found' : (statusCode ? 'Internal Server Error' : 'An unexpected error has occurred') return
{statusCode ?

{statusCode}

: null}

{title}.

} }