import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { RegisterForm } from "./RegisterForm";

export default async function Register() {
  const c = await cookies();
  const token = c.get("access_token");
  if (token) {
    throw redirect("/");
  }

  return (
    <div className="h-full flex flex-col justify-center items-center bg-neutral-100">
      <h2 className="mb-10 text-5xl font-medium">archive.local</h2>
      <RegisterForm />
    </div>
  );
}
