import { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Header } from './components/dashboard/Header'; import { Sidebar } from './components/dashboard/Sidebar'; import { NetworkStats } from './components/network/NetworkStats'; import { NetworkVisualization } from './components/network/NetworkVisualization'; import { SpecializedNetworks } from './components/network/SpecializedNetworks'; import { CDNPanel } from './components/cdn/CDNPanel'; import { WASMModules } from './components/wasm/WASMModules'; import { MCPTools } from './components/mcp/MCPTools'; import { CreditsPanel } from './components/dashboard/CreditsPanel'; import { ConsolePanel } from './components/dashboard/ConsolePanel'; import { IdentityPanel } from './components/identity/IdentityPanel'; import { DocumentationPanel } from './components/docs/DocumentationPanel'; import { CrystalLoader } from './components/common/CrystalLoader'; import { ConsentWidget } from './components/common/ConsentWidget'; import { useNetworkStore } from './stores/networkStore'; function App() { const [activeTab, setActiveTab] = useState('overview'); const [isSidebarOpen, setIsSidebarOpen] = useState(false); const [isMobile, setIsMobile] = useState(false); const [isLoading, setIsLoading] = useState(true); const { initializeEdgeNet, updateRealStats, isWASMReady } = useNetworkStore(); // Check for mobile viewport useEffect(() => { const checkMobile = () => setIsMobile(window.innerWidth < 768); checkMobile(); window.addEventListener('resize', checkMobile); return () => window.removeEventListener('resize', checkMobile); }, []); // Initialize real EdgeNet WASM module useEffect(() => { const init = async () => { try { await initializeEdgeNet(); console.log('[App] EdgeNet initialized, WASM ready:', isWASMReady); } catch (error) { console.error('[App] EdgeNet initialization failed:', error); } finally { setIsLoading(false); } }; init(); }, [initializeEdgeNet, isWASMReady]); // Update real stats from EdgeNet node useEffect(() => { const interval = setInterval(updateRealStats, 1000); return () => clearInterval(interval); }, [updateRealStats]); // Render active tab content const renderContent = () => { const content = { overview: (
Monitor your distributed compute network in real-time
Join specialized networks to earn credits by contributing compute
Manage your cryptographic identity and network participation
Activity log coming soon...
Settings panel coming soon...
Learn how to use Edge-Net and integrate it into your projects