mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
36 lines
810 B
JavaScript
36 lines
810 B
JavaScript
function Error({ statusCode }) {
|
|
const render404 = () => {
|
|
return (
|
|
<center>
|
|
<h1>404</h1>
|
|
<iframe
|
|
width="100%"
|
|
height="465"
|
|
src="https://www.youtube-nocookie.com/embed/GOzwOeONBhQ"
|
|
frameBorder="0"
|
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
allowFullScreen
|
|
/>
|
|
</center>
|
|
)
|
|
}
|
|
|
|
if (statusCode === 404) {
|
|
return render404()
|
|
} else {
|
|
return (
|
|
<p>
|
|
{statusCode
|
|
? `An error ${statusCode} occurred on server`
|
|
: 'An error occurred on client'}
|
|
</p>
|
|
)
|
|
}
|
|
}
|
|
|
|
Error.getInitialProps = ({ res, err }) => {
|
|
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
|
|
return { statusCode }
|
|
}
|
|
|
|
export default Error
|