import React from 'react'; import { BottomNavigation as MuiBottomNavigation, BottomNavigationAction, Paper, useTheme, } from '@mui/material'; import { Dashboard as DashboardIcon, CloudUpload as UploadIcon, Label as LabelIcon, Settings as SettingsIcon, } from '@mui/icons-material'; import { useNavigate, useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { usePWA } from '../../hooks/usePWA'; const BottomNavigation: React.FC = () => { const navigate = useNavigate(); const location = useLocation(); const theme = useTheme(); const { t } = useTranslation(); const isPWA = usePWA(); // Don't render if not in PWA mode if (!isPWA) { return null; } // Map paths to nav values const getNavValue = (pathname: string): string => { if (pathname === '/dashboard') return 'dashboard'; if (pathname === '/upload') return 'upload'; if (pathname === '/labels') return 'labels'; if (pathname === '/settings' || pathname === '/profile') return 'settings'; return 'dashboard'; }; const handleNavigation = (_event: React.SyntheticEvent, newValue: string) => { switch (newValue) { case 'dashboard': navigate('/dashboard'); break; case 'upload': navigate('/upload'); break; case 'labels': navigate('/labels'); break; case 'settings': navigate('/settings'); break; } }; return ( } sx={{ '&.Mui-selected': { '& .MuiBottomNavigationAction-label': { background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', backgroundClip: 'text', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', fontWeight: 600, }, }, }} /> } sx={{ '&.Mui-selected': { '& .MuiBottomNavigationAction-label': { background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', backgroundClip: 'text', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', fontWeight: 600, }, }, }} /> } sx={{ '&.Mui-selected': { '& .MuiBottomNavigationAction-label': { background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', backgroundClip: 'text', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', fontWeight: 600, }, }, }} /> } sx={{ '&.Mui-selected': { '& .MuiBottomNavigationAction-label': { background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', backgroundClip: 'text', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', fontWeight: 600, }, }, }} /> ); }; export default BottomNavigation;