Here is what I am trying to acheive
import Image from "next/image";
import Link from "next/link";
export default function Home() {
// basically hook which check for auth user
const loggedUser = false;
return (
<main className="flex flex-col items-center mt-12">
<h1 className="font-semibold text-4xl">Website</h1>
{loggedUser ? (
// will be dynamic based on user
<div>Welcome back Mubashir</div>
) : (
// should be statically generated for better speed at build time
<div className="flex gap-8">
<Link href="/login">Login</Link>
<Link href="/signup">Signup</Link>
</div>
)}
</main>
);
}
the much I understand if I add hook which checks for loggedin user all the child pages will be dynamically generated.
What can be done or what am I doing wrong?