"use client"; import { useEffect } from "react"; import NextError from "next/error"; import * as Sentry from "@sentry/nextjs"; const GlobalError = ({ error }: { error: Error & { digest?: string } }) => { useEffect(() => { Sentry.captureException(error); }, [error]); return (
{/* `NextError` is the default Next.js error page component. Its type definition requires a `statusCode` prop. However, since the App Router does not expose status codes for errors, we simply pass 0 to render a generic error message. */}