diff options
| author | Haishan <[email protected]> | 2020-10-31 18:18:04 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2020-11-01 17:42:52 +0800 |
| commit | ff1a39d04e53b428e34d46c55ecd6689189b5443 (patch) | |
| tree | 94a60abe3d28a1d729b877356bdd38d75ce655a5 /src/components/ErrorBoundaryFallback.tsx | |
| parent | e62c9165481ef12ee2310dee1c32f890b3fe4b78 (diff) | |
chore: run ts-migrate
Diffstat (limited to 'src/components/ErrorBoundaryFallback.tsx')
| -rw-r--r-- | src/components/ErrorBoundaryFallback.tsx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/components/ErrorBoundaryFallback.tsx b/src/components/ErrorBoundaryFallback.tsx new file mode 100644 index 0000000..bbaf2d7 --- /dev/null +++ b/src/components/ErrorBoundaryFallback.tsx @@ -0,0 +1,31 @@ +import React from 'react'; + +import s0 from './ErrorBoundaryFallback.module.css'; +import SvgGithub from './SvgGithub'; +import SvgYacd from './SvgYacd'; +const yacdRepoIssueUrl = 'https://github.com/haishanh/yacd/issues'; + +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} /> + haishanh/yacd + </a> + </p> + </div> + ); +} + +export default ErrorBoundaryFallback; |
