Spaces:
Running
Running
File size: 1,513 Bytes
f07b0f0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 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>
)
} |