| 1 | "use client"; |
| 2 | |
| 3 | import { useEffect } from "react"; |
| 4 | import { AlertTriangle } from "lucide-react"; |
| 5 | import { Button } from "@/components/ui/button"; |
| 6 | |
| 7 | export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { |
| 8 | useEffect(() => { |
| 9 | console.error(error); |
| 10 | }, [error]); |
| 11 | |
| 12 | return ( |
| 13 | <div className="grid min-h-[60dvh] place-items-center px-4"> |
| 14 | <div className="flex max-w-md flex-col items-center gap-4 text-center"> |
| 15 | <div className="grid h-12 w-12 place-items-center rounded-full bg-[color-mix(in_oklch,var(--color-accent-red)_14%,transparent)] text-[var(--color-accent-red)]"> |
| 16 | <AlertTriangle className="h-5 w-5" aria-hidden /> |
| 17 | </div> |
| 18 | <div className="space-y-1"> |
| 19 | <h2 className="text-base font-semibold">Something went sideways</h2> |
| 20 | <p className="text-sm text-[var(--color-fg-tertiary)]"> |
| 21 | The dashboard hit an error. Your watches are safe - try reloading the view. |
| 22 | </p> |
| 23 | </div> |
| 24 | <Button onClick={reset} variant="secondary"> |
| 25 | Try again |
| 26 | </Button> |
| 27 | </div> |
| 28 | </div> |
| 29 | ); |
| 30 | } |