Files
maternal-app/maternal-web/components/layouts/TabBar/TabBar.tsx
andupetcu 37227369d3 Add Phase 2 & 3: Web frontend with authentication and tracking features
- Initialize Next.js 14 web application with Material UI and TypeScript
- Implement authentication (login/register) with device fingerprint
- Create mobile-first responsive layout with app shell pattern
- Add tracking pages for feeding, sleep, and diaper changes
- Implement activity history with filtering
- Configure backend CORS for web frontend (port 3030)
- Update backend port to 3020, frontend to 3030
- Fix API response handling for auth endpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 21:21:22 +03:00

64 lines
1.4 KiB
TypeScript

'use client';
import { usePathname, useRouter } from 'next/navigation';
import { BottomNavigation, BottomNavigationAction, Paper } from '@mui/material';
import {
Home,
Timeline,
Chat,
Insights,
Settings,
} from '@mui/icons-material';
export const TabBar = () => {
const router = useRouter();
const pathname = usePathname();
const tabs = [
{ label: 'Home', icon: <Home />, value: '/' },
{ label: 'Track', icon: <Timeline />, value: '/track' },
{ label: 'AI Chat', icon: <Chat />, value: '/ai-assistant' },
{ label: 'Insights', icon: <Insights />, value: '/insights' },
{ label: 'Settings', icon: <Settings />, value: '/settings' },
];
return (
<Paper
sx={{
position: 'fixed',
bottom: 0,
left: 0,
right: 0,
zIndex: 1000,
}}
elevation={3}
>
<BottomNavigation
value={pathname}
onChange={(event, newValue) => {
router.push(newValue);
}}
showLabels
sx={{
height: 64,
'& .MuiBottomNavigationAction-root': {
minWidth: 60,
'&.Mui-selected': {
color: 'primary.main',
},
},
}}
>
{tabs.map((tab) => (
<BottomNavigationAction
key={tab.value}
label={tab.label}
icon={tab.icon}
value={tab.value}
/>
))}
</BottomNavigation>
</Paper>
);
};