CoolFace
Apppublic

kunjasd/anycoder-36bad3f9

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
Navbar.jsx51 linesDownload Raw Back to components
1import Link from 'next/link';2import { useSession, signOut } from 'next-auth/react';3import { FaHome, FaUser, FaSignOutAlt, FaSignInAlt } from 'react-icons/fa';4 5export default function Navbar() {6  const { data: session } = useSession();7 8  return (9    <nav className="bg-white shadow-md sticky top-0 z-50">10      <div className="max-w-6xl mx-auto px-4 py-3 flex justify-between items-center">11        <div className="flex items-center space-x-4">12          <Link href="/" className="text-xl font-bold text-primary">13            SocialApp14          </Link>15          <Link href="/" className="text-gray-600 hover:text-primary">16            <FaHome className="text-xl" />17          </Link>18        </div>19 20        <div className="flex items-center space-x-4">21          <Link22            href="https://huggingface.co/spaces/akhaliq/anycoder"23            target="_blank"24            rel="noopener noreferrer"25            className="text-sm text-gray-500 hover:text-primary"26          >27            Built with anycoder28          </Link>29 30          {session ? (31            <>32              <Link href={`/profile/${session.user.id}`} className="text-gray-600 hover:text-primary">33                <FaUser className="text-xl" />34              </Link>35              <button36                onClick={() => signOut()}37                className="text-gray-600 hover:text-primary"38              >39                <FaSignOutAlt className="text-xl" />40              </button>41            </>42          ) : (43            <Link href="/login" className="text-gray-600 hover:text-primary">44              <FaSignInAlt className="text-xl" />45            </Link>46          )}47        </div>48      </div>49    </nav>50  );51}