-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy patherrorBoundary.jsx
More file actions
65 lines (59 loc) · 1.81 KB
/
errorBoundary.jsx
File metadata and controls
65 lines (59 loc) · 1.81 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
Generic error boundary prop that handles errors and shows the fallback prop.
*/
// Local Imports
import React from "react"
// 3rd Party Imports
import { Button } from "@mantine/core"
import { CodeHighlight } from "@mantine/code-highlight"
export default function ErrorBoundaryFallback({ error }) {
return (
<div className="flex flex-col w-full h-full items-center justify-center text-center text-xl gap-y-2">
<h1 className="font-bold text-4xl text-falconred-700">
We've ran into an issue!
</h1>
<div>
<p>
Please report this{" "}
<a
href="https://github.com/Avis-Drone-Labs/FGCS/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=%5BBUG%5D"
target="_blank"
className="underline text-falconred-700"
>
here
</a>{" "}
so we can fix it as soon as possible!
</p>
<p>To get back to what you were doing, refresh or click below.</p>
<p
className="pt-2 text-sm underline text-falconred-700 hover:cursor-pointer"
onClick={() => {
document.getElementById("stack-error").hidden =
!document.getElementById("stack-error").hidden
}}
>
Show stack log
</p>
<CodeHighlight
id="stack-error"
hidden={true}
block
className="!mt-4 !bg-falcongrey-900 !rounded-lg !text-center"
language="js"
copyLabel="Copy stacktrace"
copiedLabel="Copied!"
code={error.stack}
/>
</div>
<Button
size="lg"
variant="light"
color="blue"
onClick={() => window.ipcRenderer.send("window:force-reload")}
className="mt-2"
>
Go Back!
</Button>
</div>
)
}