Skip to content

Commit daf6ed5

Browse files
committed
A more modest error fallback
1 parent 3a98a7c commit daf6ed5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/components/shared/SuspenseWrapper.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
} from "react";
99
import { ErrorBoundary, type FallbackProps } from "react-error-boundary";
1010

11-
import { Button } from "@/components/ui/button";
1211
import { Spinner } from "@/components/ui/spinner";
1312

14-
import { InfoBox } from "./InfoBox";
13+
import TooltipButton from "./Buttons/TooltipButton";
14+
import { Icon } from "../ui/icon";
1515

1616
type ErrorFallbackProps<T extends ComponentType<any>> = FallbackProps & {
1717
originalProps?: Partial<ComponentProps<T>>;
@@ -26,11 +26,14 @@ const ErrorFallback = <T extends ComponentType<any>>({
2626
resetErrorBoundary,
2727
}: ErrorFallbackProps<T>) => {
2828
return (
29-
<InfoBox title="There was an error!" variant="error">
30-
<Button onClick={() => resetErrorBoundary()} variant={"ghost"} size="xs">
31-
Try again
32-
</Button>
33-
</InfoBox>
29+
<TooltipButton
30+
tooltip="A UI element failed to render. Click to retry."
31+
onClick={() => resetErrorBoundary()}
32+
variant="ghost"
33+
size="min"
34+
>
35+
<Icon name="FileExclamationPoint" className="text-destructive" />
36+
</TooltipButton>
3437
);
3538
};
3639

0 commit comments

Comments
 (0)