import klcLogo from '../assets/klc-logo-dark.png'; import { ArrowRight, BookMarked, ChevronDown, ChevronRight, Eye, GraduationCap, Heart, LayoutDashboard, Lightbulb, LogOut, Menu, Podcast, Settings, ShoppingCart, Star, Target, TrendingUp, User, Users } from 'lucide-react'; import { useEffect, useState } from 'react'; import { useAuth } from './AuthContext'; import { useCart } from './CartContext'; import { navigateTo } from './Router'; import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar'; import { Button } from './ui/button'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './ui/collapsible'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './ui/dropdown-menu'; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger, } from './ui/sheet'; import { useLocation, useNavigate } from 'react-router-dom'; interface NavigationProps { currentPage?: string; } interface NavLink { label: string; href?: string; items?: { label: string; href: string; description?: string; icon?: any }[]; icon?: any; } const navigationItems: NavLink[] = [ { label: 'Services', // items: [ // { // label: 'Leadership Development', // href: '/services/leadership-development', // description: 'Executive and senior leadership programs', // icon: Target // }, // { // label: 'Management Development', // href: '/services/management-development', // description: 'Middle management and team leader training', // icon: Users // }, // { // label: 'Culture Competence', // href: '/services/culture-competence', // description: 'Building inclusive and high-performance cultures', // icon: Heart // }, // { // label: 'Consulting', // href: '/services/consulting', // description: 'Strategic organizational transformation', // icon: Lightbulb // }, // { // label: 'Executive Coaching', // href: '/services/executive-coaching', // description: 'Personalized leadership development', // icon: GraduationCap // } // ] // label: 'Online Courses', href: '/services' }, { label: 'About Us', // items: [ // { // label: 'Our Vision', // href: '/about/our-vision', // description: 'Our mission to transform leadership globally', // icon: Eye // }, // { // label: 'Our Impact', // href: '/about/our-impact', // description: 'Real results and measurable outcomes', // icon: TrendingUp // }, // { // label: 'Our Expertise', // href: '/about/our-expertise', // description: 'Industry-leading knowledge and experience', // icon: Star // } // ] href: '/about-us' }, { label: 'Learning Facility', href: '/learning-facility' }, { label: 'Resources', items: [ { label: 'Article Blog', href: '/learning/articles', description: 'Latest insights and thought leadership', icon: BookMarked }, { label: 'Webcast', href: '/learning/webcast', description: 'Live and recorded leadership sessions', icon: Podcast } ] }, { label: 'Online Courses', href: '/learning-online' }, { label: 'Contact Us', href: '/contact' } ]; const signInOptions = [ { label: 'Corporate HR', href: '/signin/corporate-hr', description: 'HR dashboard, team management, and bulk enrollment tools' }, { label: 'Corporate Learner', href: '/signin/corporate-learner', description: 'Employee learning dashboard and assigned programs' }, { label: 'Self-Learner', href: '/signin/self-learner', description: 'Individual professional development access' } ]; function NavLink({ item, isMobile = false }: { item: NavLink; isMobile?: boolean }) { const navigate = useNavigate(); const location = useLocation(); const [isOpen, setIsOpen] = useState(false); if (item.href) { return ( ); } if (isMobile) { return ( {item.items?.map((subItem) => ( ))} ); } return ( {item.items?.map((subItem) => ( navigate(subItem.href)} className="flex items-start gap-3 p-4 cursor-pointer transition-all duration-300 hover:transform hover:-translate-y-1" style={{ fontFamily: 'var(--font-family-base)' }} > {subItem.icon && (
)}
{subItem.label}
{subItem.description && (
{subItem.description}
)}
))}
); } function ProfileDropdown({ user }: { user: any }) { const { signOut } = useAuth(); const navigate = useNavigate(); const handleSignOut = () => { signOut(); navigate('/'); }; return (
{user.corporateName}
{user.email}
navigate('/dashboard')} className="min-h-[44px]" style={{ fontSize: '14px', fontFamily: 'var(--font-family-base)' }} > Dashboard {/* ... rest of the dropdown items with navigate() */}
); } function CartIcon() { const { cartCount } = useCart(); const navigate = useNavigate(); const handleCartClick = () => { navigate('/cart'); }; return ( ); } export function Navigation({ currentPage }: NavigationProps) { const [isScrolled, setIsScrolled] = useState(false); const { user, isAuthenticated, signOut } = useAuth(); const navigate = useNavigate(); useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 10); }; window.addEventListener('scroll', handleScroll); return () => { window.removeEventListener('scroll', handleScroll); }; }, []); const handleMobileSignOut = () => { signOut(); navigate('/'); }; return ( <> {/* Top notification bar */}
Join Our Upcoming Leadership Webinars - Transform Your Leadership Journey
{/* Main navigation header */}
); }