'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import AccountSwitcher from './AccountSwitcher'; import SearchBar from './SearchBar'; import { useAuthStore } from '@/store/authStore'; export default function Navigation() { const pathname = usePathname(); const isAuthenticated = useAuthStore((s) => s.isAuthenticated); // Public links accessible to all users const publicLinks = [ { href: '/', label: 'Home', icon: '🏠' }, { href: '/discover', label: 'Discover', icon: 'πŸ”­' }, { href: '/explore/repos', label: 'Explore', icon: 'πŸ”' }, ]; // Protected links only shown when authenticated const protectedLinks = [ { href: '/saved/repos', label: 'Following', icon: 'πŸ“¦' }, { href: '/messages', label: 'Messages', icon: 'πŸ’¬' }, { href: '/notifications', label: 'Notifications', icon: 'πŸ””' }, { href: '/profile', label: 'Profile', icon: 'πŸ‘€' }, { href: '/settings/account', label: 'Settings', icon: 'βš™οΈ' }, { href: '/claim', label: 'Claim Repo', icon: '✨' }, { href: '/tools/repo-to-text', label: 'Repoβ†’Text', icon: 'πŸ€–' }, { href: '/tools/analyze', label: 'AI Analyze', icon: '🧠' }, { href: '/reels', label: 'Reels', icon: '🎬' }, ]; // Combine links based on authentication state const links = isAuthenticated ? [...publicLinks, ...protectedLinks] : publicLinks; return ( ); }