import type { Metadata } from "next"; import { redirect } from "next/navigation"; import { getUser } from "@/lib/session"; import { SignupForm } from "./signup-form"; export const metadata: Metadata = { title: "Create account" }; export default async function SignupPage({ searchParams }: { searchParams: Promise<{ next?: string; email?: string | string[] }> }) { const sp = await searchParams; const user = await getUser(); if (user) redirect("/dashboard"); const raw = Array.isArray(sp.email) ? sp.email[0] : sp.email; const email = raw ? raw.trim().toLowerCase().slice(0, 254) : undefined; return ; }