import { useState, useEffect } from 'react'; import { motion } from 'framer-motion'; import { Home, Camera, Bell, Settings, Zap, Battery, Wifi, MessageSquare, Package, User, CheckCircle, Star, Award } from 'lucide-react'; import { useLocation } from 'wouter'; import { PullToRefresh } from '@/components/mobile/PullToRefresh'; import { SwipeableCardList } from '@/components/mobile/SwipeableCard'; import { MobileBottomNav, DEFAULT_MOBILE_TABS } from '@/components/MobileBottomNav'; import { MobileNativeBridge } from '@/components/MobileNativeBridge'; import { MobileQuickActions } from '@/components/MobileQuickActions'; import { useNativeFeatures } from '@/hooks/use-native-features'; import { useTouchGestures } from '@/hooks/use-touch-gestures'; import { haptics } from '@/lib/haptics'; import { isMobile } from '@/lib/platform'; interface DashboardCard { id: string; title: string; description: string; icon: React.ReactNode; color: string; badge?: number; action: () => void; } export default function MobileDashboard() { const [location, navigate] = useLocation(); const [activeTab, setActiveTab] = useState('home'); const [showQuickActions, setShowQuickActions] = useState(false); const native = useNativeFeatures(); // Redirect non-mobile users useEffect(() => { if (!isMobile()) { navigate('/home'); } }, [navigate]); const [cards, setCards] = useState([ { id: '1', title: 'Projects', description: 'View and manage your active projects', icon: , color: 'from-blue-500 to-cyan-500', badge: 3, action: () => navigate('/hub/projects') }, { id: '2', title: 'Messages', description: 'Check your recent conversations', icon: , color: 'from-purple-500 to-pink-500', badge: 5, action: () => navigate('/hub/messaging') }, { id: '3', title: 'Achievements', description: 'Track your progress and milestones', icon: , color: 'from-yellow-500 to-orange-500', action: () => navigate('/achievements') }, { id: '4', title: 'Network', description: 'Connect with other architects', icon: , color: 'from-green-500 to-emerald-500', action: () => navigate('/network') }, { id: '5', title: 'Notifications', description: 'View all your notifications', icon: , color: 'from-red-500 to-pink-500', badge: 2, action: () => navigate('/hub/notifications') } ]); // Redirect non-mobile users useEffect(() => { if (!isMobile()) { navigate('/home'); } }, [navigate]); const handleRefresh = async () => { haptics.light(); await new Promise(resolve => setTimeout(resolve, 1500)); native.showToast('Dashboard refreshed!'); haptics.success(); }; const handleCardSwipeLeft = (card: DashboardCard) => { haptics.medium(); setCards(prev => prev.filter(c => c.id !== card.id)); native.showToast(`${card.title} removed`); }; const handleCardSwipeRight = (card: DashboardCard) => { haptics.medium(); native.showToast(`${card.title} favorited`); }; const handleCardTap = (card: DashboardCard) => { haptics.light(); card.action(); }; useTouchGestures({ onSwipeDown: () => { setShowQuickActions(true); haptics.light(); }, onSwipeUp: () => { setShowQuickActions(false); haptics.light(); } }); if (!isMobile()) { return null; } return (
{/* Native bridge status */} {/* Header */}

AETHEX MOBILE

Device Dashboard

{/* Main content with pull-to-refresh */}
{/* Quick stats */}
} label="Points" value="1,234" color="from-yellow-500 to-orange-500" /> } label="Tasks" value="42" color="from-green-500 to-emerald-500" /> } label="Streak" value="7d" color="from-purple-500 to-pink-500" />
{/* Swipeable cards */}

Quick Access

card.id} onItemSwipeLeft={handleCardSwipeLeft} onItemSwipeRight={handleCardSwipeRight} renderItem={(card) => (
handleCardTap(card)} className="bg-gradient-to-r from-gray-900 to-gray-800 border border-emerald-500/20 rounded-xl p-4 cursor-pointer active:scale-95 transition-transform" >
{card.icon}

{card.title}

{card.badge && ( {card.badge} )}

{card.description}

)} emptyMessage="No quick access cards available" />
{/* Helpful tip */}

💡 TIP: Swipe cards left to remove, right to favorite. Pull down to refresh. Swipe down from top for quick actions.

{/* Quick actions overlay */} {showQuickActions && ( )} {/* Bottom navigation */} { setActiveTab(tabId); haptics.selection(); navigate(tabId === 'home' ? '/mobile' : `/${tabId}`); }} />
); } function StatCard({ icon, label, value, color }: { icon: React.ReactNode; label: string; value: string; color: string; }) { return (
{icon}
{value}
{label}
); }