"use client"; import { useEffect } from "react"; import { AlertTriangle } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useI18n } from "@/i18n/i18n-context"; /** * Segment-level error boundary for the onboarding flow. * * Next.js automatically mounts this component when a child server/client * component throws, keeping the rest of the app navigable instead of the * root `not-found`-style fallback. The `reset` callback is wired to the * primary action so users can retry the failed render without a full * browser reload. */ export default function OnboardingError({ error, reset, }: { error: Error & { digest?: string }; reset: () => void; }) { const { t } = useI18n(); useEffect(() => { // Surface the error to the browser console so operators looking at // devtools see the full stack; the production overlay only shows the // digest, which alone is not actionable. console.error("Onboarding render failed:", error); }, [error]); return (

{t("onboarding.errorTitle")}

{error.message || t("onboarding.errorDescription")}

{error.digest ? (

{t("onboarding.errorDigest")} {error.digest}

) : null}
); }