"use client";

import { useEffect } from "react";
import "@/styles/globals.css";
import { I18nProvider } from "@/lib/i18n/context";
import ReceiptErrorPage from "@/components/error/ReceiptErrorPage";

export default function GlobalError({
  error,
  reset,
}: {
  error: Error & { digest?: string };
  reset: () => void;
}) {
  useEffect(() => {
    console.error(error);
  }, [error]);

  return (
    <html lang="en">
      <body className="min-h-screen bg-[#F6F9FF] text-[#161C22] font-sans antialiased">
        <I18nProvider>
          <ReceiptErrorPage variant="error" homeHref="/" onRetry={reset} />
        </I18nProvider>
      </body>
    </html>
  );
}
