'use client'; import { useAuth } from '../context/AuthContext'; import Link from 'next/link'; import { useState } from 'react'; export default function Header() { const { user, logout } = useAuth(); const [isProfileMenuOpen, setIsProfileMenuOpen] = useState(false); const handleLogout = async () => { try { await logout(); setIsProfileMenuOpen(false); } catch (error) { console.error('Failed to log out:', error); } }; return (
{/* Logo */} Mystery Box {/* Navigation */} {/* Auth Buttons / Profile */}
{user ? (
{/* Profile Dropdown */} {isProfileMenuOpen && (
{/* setIsProfileMenuOpen(false)} > Profile setIsProfileMenuOpen(false)} > Settings */}
)}
) : (
Sign in Sign up
)}
); }