import Link from "next/link" import { useSession } from "next-auth/react" import styles from "./header.module.css" // The approach used in this component shows how to built a sign in and sign out // component that works on pages which support both client and server side // rendering, and avoids any flash incorrect content on initial page load. export default function Header() { const { data: session, status } = useSession() return (

{!session && ( <> You are not signed in Sign in )} {session && ( <> {session.user.image && ( )} Signed in as
{session.user.email} {session.user.name ? `(${session.user.name})` : null}
Sign out )}

) }