summaryrefslogtreecommitdiff
path: root/src/app/ErrorBoundaryFallback.tsx
blob: ee6ca0cc301f8e052d27a24ec50ee2db7834f7f7 (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
32
33
import React from 'react';

import SvgGithub from '~/components/shared/SvgGithub';
import SvgYacd from '~/components/shared/SvgYacd';

import s0 from './ErrorBoundaryFallback.module.scss';

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;