'use client' import { useHelpers } from '@/lib/client-helpers' import { HabitIcon, TaskIcon } from '@/lib/constants' import { Calendar, Coins, Gift, Home } from 'lucide-react' import Link from 'next/link' import { useEffect, useState } from 'react' import AboutModal from './AboutModal' import { usePathname } from 'next/navigation' type ViewPort = 'main' | 'mobile' const navItems = () => [ { icon: Home, label: 'Dashboard', href: '/', position: 'main' }, { icon: HabitIcon, label: 'Habits', href: '/habits', position: 'main' }, { icon: TaskIcon, label: 'Tasks', href: '/tasks', position: 'main' }, { icon: Calendar, label: 'Calendar', href: '/calendar', position: 'main' }, { icon: Gift, label: 'Wishlist', href: '/wishlist', position: 'main' }, { icon: Coins, label: 'Coins', href: '/coins', position: 'main' }, ] interface NavigationProps { viewPort: ViewPort } export default function Navigation({ viewPort }: NavigationProps) { const [showAbout, setShowAbout] = useState(false) const [isMobileView, setIsMobileView] = useState(false) const { isIOS } = useHelpers() const pathname = usePathname(); useEffect(() => { const handleResize = () => { setIsMobileView(window.innerWidth < 1024) } // Set initial value handleResize() // Add event listener window.addEventListener('resize', handleResize) // Cleanup return () => window.removeEventListener('resize', handleResize) }, []) if (viewPort === 'mobile' && isMobileView) { return ( <>
{/* Add padding at the bottom to prevent content from being hidden */}