import { View, Text, Pressable } from 'react-native'; import { useRouter, usePathname } from 'expo-router'; import { Ionicons } from '@expo/vector-icons'; import { useAuth } from '~/contexts/AuthContext'; type NavItem = { route: string; label: string; icon: keyof typeof Ionicons.glyphMap; }; export function DesktopNav() { const router = useRouter(); const pathname = usePathname(); const { user, signOut } = useAuth(); const navItems: NavItem[] = [ { route: '/(tabs)', label: 'Galerie', icon: 'image' }, { route: '/(tabs)/explore', label: 'Entdecken', icon: 'compass' }, { route: '/(tabs)/generate', label: 'Studio', icon: 'color-palette' }, { route: '/(tabs)/profile', label: 'Profil', icon: 'person' }, ]; const isActiveRoute = (route: string) => { if (route === '/(tabs)' && (pathname === '/(tabs)' || pathname === '/')) { return true; } return pathname === route; }; return ( {/* Logo/Brand on the left */} Picture {/* Navigation Items */} {navItems.map((item) => ( router.push(item.route as any)} className={({ pressed }) => `flex-row items-center px-4 py-3 mr-2 border-b-2 ${ isActiveRoute(item.route) ? 'border-indigo-500' : 'border-transparent' } ${pressed ? 'opacity-70' : 'opacity-100'}` } > {item.label} ))} {/* User actions on the right */} {user && ( <> router.push('/tags')} className={({ pressed }) => `px-3 py-2 mr-2 ${pressed ? 'opacity-70' : 'opacity-100'}` } > Tags `px-3 py-2 ${pressed ? 'opacity-70' : 'opacity-100'}` } > Abmelden )} ); }