Spaces:
Running
Running
Download components/BottomNavigation.js from Leogron777/anycoder-fa44b9d5: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/spaces/Leogron777/anycoder-fa44b9d5/resolve/main/components/BottomNavigation.js
- Command line
-
hf download hf://spaces/Leogron777/anycoder-fa44b9d5/components/BottomNavigation.js
-
curl -L -o BottomNavigation.js https://huggingface.co/spaces/Leogron777/anycoder-fa44b9d5/resolve/main/components/BottomNavigation.js
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> | |
| ) | |
| } |