Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

611 B
Raw Blame
"use client";

import { useEffect } from "react";
import { useTranslations } from "next-intl";
import { RouteError } from "@repowise-dev/ui/shared/route-states";

export default function GlobalError({
  error,
  reset,
}: {
  error: Error & { digest?: string };
  reset: () => void;
}) {
  const t = useTranslations("errors");

  useEffect(() => {
    console.error(error);
  }, [error]);

  return (
    <RouteError
      title={t("errorTitle")}
      message={t("errorFallback")}
      digest={error.digest}
      digestLabel={t("digest")}
      onRetry={reset}
      retryLabel={t("tryAgain")}
    />
  );
}