Skip to content

Automated PR: aether-bot-24-03-25-8am-41-06 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 1 addition & 55 deletions app/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1 @@
"use client";

import { useState } from "react";
import Link from "next/link";
import { useSession, signIn, signOut } from "next-auth/react";
import { FiLogIn, FiLogOut, FiUser } from "react-icons/fi";

const Navbar = () => {
const { data: session } = useSession();
const [dropdownOpen, setDropdownOpen] = useState(false);

return (
<nav className="w-full bg-gray-900 text-gray-100 shadow-md">
<div className="max-w-6xl mx-auto px-4 py-3 flex justify-between items-center">
{/* App Name */}
<Link href="/" className="text-xl font-bold text-blue-400">
Aether AI
</Link>

{/* Auth Controls */}
<div className="relative">
{session ? (
<div className="flex items-center gap-3">
<button onClick={() => setDropdownOpen(!dropdownOpen)} className="flex items-center gap-2 text-gray-300 hover:text-white transition">
<FiUser className="text-lg" />
<span className="hidden sm:inline">{session.user?.username}</span>
</button>

{/* Dropdown */}
{dropdownOpen && (
<div className="absolute right-0 mt-2 w-40 bg-gray-800 rounded-lg shadow-lg">
<button
onClick={() => signOut()}
className="w-full px-4 py-2 text-left text-sm text-gray-300 hover:bg-gray-700 flex items-center gap-2"
>
<FiLogOut /> Sign Out
</button>
</div>
)}
</div>
) : (
<button
onClick={() => signIn()}
className="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition"
>
<FiLogIn /> Sign In
</button>
)}
</div>
</div>
</nav>
);
};

export default Navbar;
No code provided