import React from 'react'; import { IonTabs, IonTabBar, IonTabButton, IonLabel, IonIcon } from '@ionic/react'; import { list, search, heart, add, mic, documentText, time, trophy, people } from 'ionicons/icons'; import { useLocation, useNavigate } from 'react-router-dom'; const Navigation: React.FC = () => { const location = useLocation(); const navigate = useNavigate(); const navItems = [ { path: '/queue', label: 'Queue', icon: list }, { path: '/search', label: 'Search', icon: search }, { path: '/favorites', label: 'Favorites', icon: heart }, { path: '/new-songs', label: 'New Songs', icon: add }, { path: '/artists', label: 'Artists', icon: mic }, { path: '/song-lists', label: 'Song Lists', icon: documentText }, { path: '/history', label: 'History', icon: time }, { path: '/top-played', label: 'Top 100', icon: trophy }, { path: '/singers', label: 'Singers', icon: people }, ]; // For mobile, show bottom tabs with main features const mobileNavItems = [ { path: '/queue', label: 'Queue', icon: list }, { path: '/search', label: 'Search', icon: search }, { path: '/favorites', label: 'Favorites', icon: heart }, { path: '/history', label: 'History', icon: time }, ]; // Check if we're on mobile (you can adjust this breakpoint) const isMobile = window.innerWidth < 768; const currentItems = isMobile ? mobileNavItems : navItems; return ( <> {isMobile ? ( {currentItems.map((item) => ( navigate(item.path)} > {item.label} ))} ) : ( {currentItems.map((item) => ( navigate(item.path)} className={` flex items-center px-3 py-4 text-sm font-medium border-b-2 transition-colors ${location.pathname === item.path ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300' } `} > {item.label} ))} )} > ); }; export default Navigation;