summaryrefslogtreecommitdiff
path: root/src/components/ErrorBoundaryFallback.js
blob: 211985ad3b09bce6b9c0b73762575f2886a19d85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from 'react';
import PropTypes from 'prop-types';
import SvgYacd from './SvgYacd';
import SvgGithub from './SvgGithub';

import s0 from './ErrorBoundaryFallback.module.css';
const yacdRepoIssueUrl = 'https://github.com/haishanh/yacd/issues';

function ErrorBoundaryFallback({ message, detail }) {
  return (
    <div className={s0.root}>
      <div className={s0.yacd}>
        <SvgYacd width={150} height={150} />
      </div>
      {message ? <h1>{message}</h1> : null}
      {detail ? <p>{detail}</p> : null}
      <p>
        <a className={s0.link} href={yacdRepoIssueUrl}>
          <SvgGithub width={16} height={16} />
          haishanh/yacd
        </a>
      </p>
    </div>
  );
}

ErrorBoundaryFallback.propTypes = {
  message: PropTypes.string
};

export default ErrorBoundaryFallback;