'use client';

import { useRouter } from 'next/navigation';
import { routes } from '@/lib/routing/RouteConfig';
import { GlobalErrorScreen } from '@/components/errors/GlobalErrorScreen';
import './globals.css';

export default function GlobalError({
  error,
  reset,
}: {
  error: Error & { digest?: string };
  reset: () => void;
}) {
  const router = useRouter();
  
  return (
    <html lang="en" className="dark scroll-smooth overflow-x-hidden">
      <body className="antialiased bg-base-black text-white overflow-x-hidden">
        <GlobalErrorScreen
          error={error}
          reset={reset}
          onHome={() => router.push(routes.public.home)}
        />
      </body>
    </html>
  );
}
