'use client';

import { useEffect } from 'react';

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

  return (
    <main className="flex min-h-screen flex-col items-center justify-center gap-4 p-6 text-center">
      <h1 className="text-4xl font-bold">500</h1>
      <p className="text-muted-foreground">Ocorreu um erro inesperado.</p>
      <button onClick={reset} className="text-sm underline underline-offset-4">
        Tentar novamente
      </button>
    </main>
  );
}
