summaryrefslogtreecommitdiff
path: root/src/components/ErrorBoundaryFallback.tsx
blob: 9f41d916efeb4b6129b92c101449548933fc8c86 (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 s0 from './ErrorBoundaryFallback.module.scss';
import SvgGithub from './SvgGithub';
import SvgYacd from './SvgYacd';
const yacdRepoIssueUrl = 'https://github.com/metacubex/yacd';

type Props = {
  message?: string;
  detail?: string;
};

function ErrorBoundaryFallback({ message, detail }: Props) {
  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} />
          metacubex/yacd
        </a>
      </p>
    </div>
  );
}

export default ErrorBoundaryFallback;