import React from 'react'; import { YStack, XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; import { Pressable } from '@tamagui/react-native-web-lite'; import { Home, CheckSquare, Bell, User } from 'lucide-react'; import { useTheme } from '@tamagui/core'; import { useTranslation } from 'react-i18next'; import { useAlertsBadge } from '../hooks/useAlertsBadge'; export type NavKey = 'events' | 'tasks' | 'alerts' | 'profile'; export function BottomNav({ active, onNavigate }: { active: NavKey; onNavigate: (key: NavKey) => void }) { const { t } = useTranslation('mobile'); const theme = useTheme(); const { count: alertCount } = useAlertsBadge(); const items: Array<{ key: NavKey; icon: React.ComponentType<{ size?: number; color?: string }>; label: string }> = [ { key: 'events', icon: Home, label: t('nav.events', 'Events') }, { key: 'tasks', icon: CheckSquare, label: t('nav.tasks', 'Tasks') }, { key: 'alerts', icon: Bell, label: t('nav.alerts', 'Alerts') }, { key: 'profile', icon: User, label: t('nav.profile', 'Profile') }, ]; return ( {items.map((item) => { const activeState = item.key === active; const IconCmp = item.icon; return ( onNavigate(item.key)}> {item.label} {item.key === 'alerts' && alertCount > 0 ? ( {alertCount > 9 ? '9+' : alertCount} ) : null} ); })} ); }