mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-01-29 16:11:13 -05:00
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import {useSession, signOut} from "next-auth/react";
|
|
|
|
export default function Header() {
|
|
const {data: session} = useSession();
|
|
|
|
console.log(session);
|
|
|
|
return (
|
|
<header className="w-full bg-white shadow-md py-4 px-8">
|
|
<nav className="flex justify-between items-center">
|
|
<Link href="/" className="text-xl font-bold text-gray-800 hover:text-blue-600 transition-colors">
|
|
BayesBond
|
|
</Link>
|
|
<div className="flex items-center space-x-4">
|
|
<Link
|
|
href="/profiles"
|
|
className="bg-blue-500 text-white px-4 py-2 rounded-lg hover:bg-blue-600 transition"
|
|
>
|
|
Profiles
|
|
</Link>
|
|
{session ? (
|
|
<>
|
|
<div className="flex items-center space-x-4">
|
|
<div className="text-sm text-gray-500">
|
|
{session.user?.name && <div>{session.user.name}</div>}
|
|
<div>{session.user?.email}</div>
|
|
</div>
|
|
<button
|
|
onClick={() => signOut({callbackUrl: "/"})}
|
|
className="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition"
|
|
>
|
|
Sign Out
|
|
</button>
|
|
</div>
|
|
</>
|
|
) : (
|
|
<>
|
|
<Link href="/login" className="bg-blue-500 text-white px-4 py-2 rounded-lg hover:bg-blue-600 transition">
|
|
Sign In
|
|
</Link>
|
|
<Link href="/register"
|
|
className="bg-blue-500 text-white px-4 py-2 rounded-lg hover:bg-blue-600 transition">
|
|
Sign Up
|
|
</Link>
|
|
</>
|
|
)}
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
);
|
|
}
|