"use client"; import { Suspense, useState, useEffect } from "react"; import AuthLoginForm from "./AuthLoginForm" import SigninButton from "./SigninButton"; import { handleGoogleLogin } from "@/app/actions/GoogleAction"; import { useSearchParams } from "next/navigation"; function LoginContent() { const [elogin, setElogin] = useState(false); const showEmailLogin = () => { // lets you toggle on and off showEmailLogin which is used to decide if the authloginform is shown setElogin(!elogin); }; const searchParams = useSearchParams(); const isJustRegisted = searchParams.get("registered") === "true"; // if redirected with reigstered = true useEffect(() => { if (isJustRegisted) { setElogin(true); } }, [isJustRegisted]); return ( <>

Please Sign In

{isJustRegisted && ( // display if redirect with search param
Account created successfully. You can now sign in.
)}
{elogin ? : ""}
) } export default function LoginPage() { // displays fallback while url dependent content loads (searchparams), errors if it tries to prepare page in advance return ( <> Loading login..

}>
); }