Allow multiple errors and dismissing errors

This commit is contained in:
Misode
2021-07-02 02:59:19 +02:00
parent f43cb03cc3
commit 985057ab4e
5 changed files with 40 additions and 10 deletions

View File

@@ -1,5 +1,12 @@
export function ErrorPanel({ error }: { error: string }) {
import { Octicon } from './Octicon'
type ErrorPanelProps = {
error: string,
onDismiss?: () => unknown,
}
export function ErrorPanel({ error, onDismiss }: ErrorPanelProps) {
return <div class="error">
{onDismiss && <div class="error-dismiss" onClick={onDismiss}>{Octicon.x}</div>}
<h3>{error}</h3>
<p>You can report this as a bug <a href="https://github.com/misode/misode.github.io/issues/new" target="_blank">on GitHub</a></p>
</div>