import { useRouter } from 'next/router'; import Link from 'next/link'; import { useState } from 'react'; export default function MobileNavigation({ onMenuOpen }) { const router = useRouter(); // Navigation items for the bottom bar const navigationItems = [ { name: 'Cards', href: '/cards', icon: 'cards', active: router.pathname === '/cards' }, { name: 'Decks', href: '/decks', icon: 'decks', active: router.pathname === '/decks' }, { name: 'Dashboard', href: '/dashboard', icon: 'dashboard', active: router.pathname === '/dashboard' || router.pathname === '/collections' || router.pathname === '/my-cards' || router.pathname === '/analytics', isPrimary: true // This will be the raised center button }, { name: 'Community', href: '/community', icon: 'community', active: router.pathname.startsWith('/community') }, { name: 'More', href: '#', icon: 'more', onClick: onMenuOpen, active: false } ]; const getIcon = (iconName, isActive = false, isPrimary = false) => { const iconClass = isPrimary ? "h-7 w-7" : "h-6 w-6"; const strokeWidth = isActive ? 2.5 : 2; const icons = { cards: ( ), decks: ( ), dashboard: ( ), community: ( ), more: ( ) }; return icons[iconName] || icons.dashboard; }; return (
{/* Background with blur effect */}
{/* Navigation Content */}
{navigationItems.map((item) => { if (item.isPrimary) { // Primary/Dashboard button - raised and prominent return (
{/* Raised background circle */}
{/* Button content */} {/* Label below raised button */} {item.name}
); } else { // Regular navigation buttons const ButtonComponent = item.onClick ? 'button' : Link; const buttonProps = item.onClick ? { onClick: item.onClick } : { href: item.href }; return (
{getIcon(item.icon, item.active)}
{item.name}
); } })}
{/* Safe area padding for devices with home indicator */}
); }