import { Suspense } from "react";
import OperatorLoginClient from "./OperatorLoginClient";

/**
 * Server-component shell that wraps the client login form in a Suspense
 * boundary. The client uses useSearchParams() to read ?next=<path>; Next.js
 * requires that to live inside Suspense so the CSR bailout doesn't fail the
 * prerender during `next build`.
 */
export default function OperatorLoginPage() {
  return (
    <Suspense
      fallback={
        <main className="min-h-dvh flex items-center justify-center p-6 bg-slate-50">
          <p className="text-slate-500">Loading…</p>
        </main>
      }
    >
      <OperatorLoginClient />
    </Suspense>
  );
}
