'use client'; /** * Mobile Bottom Bar Navigation * * Fixed bottom navigation for mobile devices (< 768px). * Shows three buttons: Convo, Edit, Galaxy * Highlights the active mode based on app state machine. */ import { Group, Button, Paper, ActionIcon, Box } from '@mantine/core'; import { IconMessageCircle, IconEdit, IconUniverse, IconUser } from '@tabler/icons-react'; import { useSelector } from '@xstate/react'; import { useAppMachine } from '@/hooks/useAppMachine'; import { UserMenu } from '@/components/UserMenu'; export function MobileBottomBar() { const actor = useAppMachine(); const state = useSelector(actor, (state) => state); const send = actor.send; const handleNavigation = (target: 'convo' | 'edit' | 'galaxy') => { console.log('[Mobile Nav] Navigating to:', target); if (target === 'convo') { send({ type: 'NAVIGATE_TO_CONVO' }); } else if (target === 'edit') { send({ type: 'NAVIGATE_TO_EDIT' }); } else if (target === 'galaxy') { send({ type: 'NAVIGATE_TO_GALAXY' }); } }; const isConvo = state.matches('convo'); const isEdit = state.matches('edit'); const isGalaxy = state.matches('galaxy'); console.log('[Mobile Nav] Current state:', state.value, { isConvo, isEdit, isGalaxy, }); return ( handleNavigation('convo')} size={48} radius="md" > handleNavigation('edit')} size={48} radius="md" > handleNavigation('galaxy')} size={48} radius="md" > ); }