import React from 'react' import {Heading} from '@primer/components' import {redirectTrailingSlash} from '../docs/redirect' export default class extends React.Component { static getInitialProps(context) { // redirect trailing slash URLs to "clean" ones without return redirectTrailingSlash(context) || getErrorProps(context) } render() { const {url, statusCode = 500} = this.props return <> Whoops! That’s a {statusCode}.

We couldn’t find anything at {url}. {null && <>Have you tried searching?}

} } function getErrorProps({req, res, err}) { const {statusCode} = err || res return {statusCode, url: req.url} }