import Link from "next/link"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { authClient } from "@kan/auth/client"; import { Auth } from "~/components/AuthForm"; import { PageHead } from "~/components/PageHead"; import PatternedBackground from "~/components/PatternedBackground"; import { env } from "next-runtime-env"; export default function SignupPage() { const router = useRouter(); const [isMagicLinkSent, setIsMagicLinkSent] = useState(false); const [magicLinkRecipient, setMagicLinkRecipient] = useState(""); const handleMagicLinkSent = (value: boolean, recipient: string) => { setIsMagicLinkSent(value); setMagicLinkRecipient(recipient); }; const { data } = authClient.useSession(); if (data?.user.id) router.push("/boards"); if (env("NEXT_PUBLIC_DISABLE_SIGN_UP")?.toLowerCase() === "true") { return (

Sign up is disabled

Login
) } return ( <>

kan.bn

{isMagicLinkSent ? "Check your inbox" : "Create your account"}

{isMagicLinkSent ? (

{`Click on the link we've sent to ${magicLinkRecipient} to sign in.`}

) : (
)}

Already have an account?{" "} Sign in

); }