2026-03-12 01:28:39 -07:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import posthog from "posthog-js";
|
|
|
|
|
import { useEffect } from "react";
|
|
|
|
|
|
2026-03-27 03:17:05 -07:00
|
|
|
export default function ErrorPage({
|
2026-03-12 01:28:39 -07:00
|
|
|
error,
|
|
|
|
|
reset,
|
|
|
|
|
}: {
|
2026-03-27 03:17:05 -07:00
|
|
|
error: globalThis.Error & { digest?: string };
|
2026-03-12 01:28:39 -07:00
|
|
|
reset: () => void;
|
|
|
|
|
}) {
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
posthog.captureException(error);
|
|
|
|
|
}, [error]);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex min-h-[50vh] flex-col items-center justify-center gap-4 text-center">
|
|
|
|
|
<h2 className="text-2xl font-semibold">Something went wrong</h2>
|
|
|
|
|
<p className="text-muted-foreground max-w-md">
|
|
|
|
|
An unexpected error occurred. Please try again.
|
|
|
|
|
</p>
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={reset}
|
|
|
|
|
className="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors"
|
|
|
|
|
>
|
|
|
|
|
Try again
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|