import React from 'react'; import { Dumbbell, History as HistoryIcon, BarChart2, MessageSquare, ClipboardList, User } from 'lucide-react'; import { useLocation, useNavigate } from 'react-router-dom'; import { t } from '../services/i18n'; import { Language } from '../types'; interface NavbarProps { lang: Language; } const Navbar: React.FC = ({ lang }) => { const navigate = useNavigate(); const location = useLocation(); const navItems = [ { path: '/', icon: Dumbbell, label: t('tab_tracker', lang) }, { path: '/plans', icon: ClipboardList, label: t('tab_plans', lang) }, { path: '/history', icon: HistoryIcon, label: t('tab_history', lang) }, { path: '/stats', icon: BarChart2, label: t('tab_stats', lang) }, { path: '/coach', icon: MessageSquare, label: t('tab_ai', lang) }, { path: '/profile', icon: User, label: t('tab_profile', lang) }, ]; const currentPath = location.pathname; return ( <> {/* MOBILE: Bottom Navigation Bar (MD3) */}
{navItems.map((item) => { const isActive = currentPath === item.path || (item.path !== '/' && currentPath.startsWith(item.path)); return ( ); })}
{/* DESKTOP: Navigation Rail (MD3) */}
{navItems.map((item) => { const isActive = currentPath === item.path || (item.path !== '/' && currentPath.startsWith(item.path)); return ( ); })}
); }; export default Navbar;