anycoder-fa44b9d5 / components /BottomNavigation.js
Leogron777's picture
Upload components/BottomNavigation.js with huggingface_hub
f07b0f0 verified
Raw History Blame Contribute Delete
1.51 kB
import { Home, CheckSquare, ScanNetwork, Users, Calendar } from 'lucide-react'
import { useRouter } from 'next/router'
const navigationItems = [
{ id: 'home', label: 'Home', icon: Home, route: '/' },
{ id: 'tasks', label: 'Tasks', icon: CheckSquare, route: '/tasks' },
{ id: 'scan', label: 'Scan', icon: ScanNetwork, route: '/scan' },
{ id: 'network', label: 'Network', icon: Users, route: '/network' },
{ id: 'calendar', label: 'Calendar', icon: Calendar, route: '/calendar' }
]
export default function BottomNavigation() {
const router = useRouter()
const currentRoute = router.pathname
return (
<div className="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 safe-area-bottom z-50">
<div className="flex justify-around items-center h-16">
{navigationItems.map((item) => {
const isActive = currentRoute === item.route || (currentRoute === '/' && item.id === 'home')
const Icon = item.icon
return (
<button
key={item.id}
onClick={() => router.push(item.route)}
className={`flex flex-col items-center justify-center p-2 transition-colors duration-200 ${
isActive ? 'text-primary-600' : 'text-gray-400 hover:text-gray-600'
}`}
>
<Icon className="w-6 h-6 mb-1" />
<span className="text-xs font-medium">{item.label}</span>
</button>
)
})}
</div>
</div>
)
}