'use client'; import { useState } from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { useSession, signOut } from 'next-auth/react'; const navLinks = [ { label: 'Education', href: '/education' }, { label: 'About Us', href: '/about' }, { label: "FAQ's", href: '/faq' }, ]; export function CommonHeader() { const { data: session } = useSession(); const [showProfileMenu, setShowProfileMenu] = useState(false); const userName = session?.user?.name; const userEmail = session?.user?.email; const userRole = (session?.user as any)?.role; // Determine dashboard link based on user role const dashboardLink = userRole === 'AGENT' ? '/agent/dashboard' : '/user/userdashboard'; return (
{/* Logo */} RE-QuestN {/* Navigation */} {/* Right Side Icons */}
{session ? ( <> {/* Notification Bell */} {/* Profile Icon with Dropdown */}
{/* Profile Dropdown Menu */} {showProfileMenu && (

{userName || 'User'}

{userEmail}

setShowProfileMenu(false)} > Dashboard setShowProfileMenu(false)} > Settings
)}
) : (
Login Sign Up
)} {/* Mobile Menu Button */}
); }