import { SignUpForm } from "@/components/sign-up-form";
import { Suspense } from "react";

export default function Page({
  searchParams,
}: {
  searchParams: Promise<{ email?: string }>;
}) {
  return (
    <div className="flex min-h-svh w-full items-center justify-center p-6 md:p-10">
      <div className="w-full max-w-sm">
        <Suspense>
          <SignUpFormContent searchParams={searchParams} />
        </Suspense>
      </div>
    </div>
  );
}

async function SignUpFormContent({
  searchParams,
}: {
  searchParams: Promise<{ email?: string }>;
}) {
  const email = (await searchParams).email || "";
  return <SignUpForm initialEmail={email} />;
}
