"use client";

import { useEffect } from "react";
import { ErrorState } from "@/components/ui/error-state";

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

  return (
    <ErrorState
      title="An error occurred while loading checkout"
      description="Your transaction may not have failed — your order status stays safe in our system. Try reloading, or check your order history in the dashboard."
      onRetry={reset}
    />
  );
}
