This commit is contained in:
PxlLoewe
2025-02-15 18:06:21 +01:00
parent 1fba206dbf
commit bb9feaa1cc
14 changed files with 224 additions and 14 deletions

View File

@@ -0,0 +1,23 @@
'use client';
import { useSession } from 'next-auth/react';
import Link from 'next/link';
export const Header = () => {
const session = useSession();
console.log(session);
return (
<header className="flex justify-between items-center p-4">
<h1 className="text-2xl font-bold">Hub</h1>
<div>
{session.status === 'authenticated' ? (
<p>{session.data?.user.firstname}</p>
) : (
<Link href="/login">
<button className="btn">Login</button>
</Link>
)}
</div>
</header>
);
};