this repo has no description
1import type { FallbackProps } from "react-error-boundary";
2import { Button } from "~/design-system/ui/button";
3
4export function DemoErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
5 return (
6 <div className="min-h-125 flex flex-col items-center justify-center gap-4 border border-(--border-default) bg-(--bg-card) p-6">
7 <div className="text-center space-y-2">
8 <p className="text-sm font-mono font-semibold text-(--status-error)">
9 Failed to load Pokémon data
10 </p>
11 <p className="max-w-md text-xs font-mono text-(--text-muted) leading-relaxed">
12 {getErrorMessage(error)}
13 </p>
14 </div>
15 <Button onClick={resetErrorBoundary} size="sm" className="font-mono">
16 Try again
17 </Button>
18 </div>
19 );
20}
21
22function getErrorMessage(error: unknown): string {
23 if (error instanceof Error) return error.message;
24 return "An unknown error occurred";
25}