'use client';

import { useSession } from 'next-auth/react';
import { useEffect } from 'react';

export default function Home() {
  const { data: session, status, update } = useSession();
  console.log(session, status);
  useEffect(() => {
    update();
  }, []);
  return (
    <div>
      <h1 className="text-5xl">Hub</h1>
      {!session && <h2 className="text-error text-xl">Not signed in</h2>}
      {session?.user?.firstname && <h1>Hi, {session?.user?.firstname}</h1>}
    </div>
  );
}
