import Link from "next/link"; import { useState } from "react"; // import { useRouter } from "next/navigation"; import { Auth } from "~/components/AuthForm"; import { PageHead } from "~/components/PageHead"; import PatternedBackground from "~/components/PatternedBackground"; // import { api } from "~/utils/api"; export default function LoginPage() { // const router = useRouter(); const [isMagicLinkSent, setIsMagicLinkSent] = useState(false); const [magicLinkRecipient, setMagicLinkRecipient] = useState(""); const handleMagicLinkSent = (value: boolean, recipient: string) => { setIsMagicLinkSent(value); setMagicLinkRecipient(recipient); }; // const authCookieExists = document.cookie // .split("; ") // .some((cookie) => cookie.includes("auth-token")); // const { data } = api.user.getUser.useQuery(undefined, { // enabled: authCookieExists ? true : false, // }); // if (data?.id) router.push("/boards"); return ( <>

kan.bn

{isMagicLinkSent ? "Check your inbox" : "Welcome back"}

{isMagicLinkSent ? (

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

) : (
)}

Don't have an account?{" "} Sign up

); }