import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";
import Sidebar from "../../_components/Sidebar";
import MultiStepForm from "./_components/MultiStepForm";

export default async function NewPatientPage() {
  const session = await auth();

  if (!session?.user?.id) {
    redirect("/login");
  }

  if (session.user.role !== "FAMILY") {
    redirect("/dashboard");
  }

  return (
    <div className="min-h-screen bg-zinc-950 text-zinc-100">
      <Sidebar />
      <main className="p-4 md:ml-64 md:p-8">
        <div className="mx-auto max-w-3xl">
          <div className="mb-8 text-center">
            <h1 className="text-2xl font-bold text-zinc-100">Add New Patient</h1>
            <p className="mt-1 text-sm text-zinc-400">
              Complete the 4 steps below to register a new patient.
            </p>
          </div>
          <MultiStepForm />
        </div>
      </main>
    </div>
  );
}

