-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathErrorFallback.jsx
More file actions
32 lines (30 loc) · 880 Bytes
/
ErrorFallback.jsx
File metadata and controls
32 lines (30 loc) · 880 Bytes
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
import { Button } from "@usace/groundwork";
import { FaArrowLeft } from "react-icons/fa";
import PropTypes from "prop-types";
import { Link } from "react-router-dom";
export default function ErrorFallback({ error }) {
return (
<div className="p-6">
<h2 className="text-lg font-semibold text-red-600">Something went wrong</h2>
<p className="mt-2 text-gray-700">
{error?.message || "An unexpected error occurred."}
</p>
<p>
<Link to="/">
<Button
size={"lg"}
color={"dark"}
className="mt-4 flex flex-row text-white font-bold py-3 px-6 rounded"
>
<FaArrowLeft className="mr-2" /> Go Home
</Button>
</Link>
</p>
</div>
);
}
ErrorFallback.propTypes = {
error: PropTypes.shape({
message: PropTypes.string,
}),
};