﻿"use client";

export default function GlobalError({
  error,
  unstable_retry,
}: {
  error: Error & { digest?: string };
  unstable_retry: () => void;
}) {
  return (
    <html lang="es">
      <body>
        <main
          style={{
            minHeight: "100vh",
            display: "flex",
            flexDirection: "column",
            alignItems: "center",
            justifyContent: "center",
            padding: "24px",
            fontFamily: "Arial, sans-serif",
            textAlign: "center",
          }}
        >
          <h1>Ocurrió un error</h1>

          <p>
            La aplicación encontró un problema inesperado.
          </p>

          <button
            type="button"
            onClick={() => unstable_retry()}
            style={{
              marginTop: "16px",
              padding: "10px 18px",
              border: "0",
              borderRadius: "8px",
              cursor: "pointer",
            }}
          >
            Intentar nuevamente
          </button>
        </main>
      </body>
    </html>
  );
}
