import React, { useState, useEffect } from 'react'; import { GameProvider } from './context/GameContext'; import { HostView } from './components/HostView'; import { PlayerView } from './components/PlayerView'; import { SpectatorView } from './components/SpectatorView'; import { Monitor, Smartphone, LayoutDashboard } from 'lucide-react'; const App: React.FC = () => { const [view, setView] = useState<'HOST' | 'PLAYER' | 'SPECTATOR'>('SPECTATOR'); // Simple hash routing for demo purposes useEffect(() => { const handleHashChange = () => { const hash = window.location.hash; if (hash === '#host') setView('HOST'); else if (hash === '#player') setView('PLAYER'); else setView('SPECTATOR'); }; handleHashChange(); window.addEventListener('hashchange', handleHashChange); return () => window.removeEventListener('hashchange', handleHashChange); }, []); const navigate = (newView: 'HOST' | 'PLAYER' | 'SPECTATOR') => { setView(newView); window.location.hash = newView.toLowerCase(); }; const renderView = () => { switch (view) { case 'HOST': return ; case 'PLAYER': return ; case 'SPECTATOR': return ; default: return ; } }; return (
{/* Top Navigation Bar */} {/* Main Content Area */}
{renderView()}
); }; interface NavButtonProps { active: boolean; onClick: () => void; icon: React.ReactNode; label: string; } const NavButton: React.FC = ({ active, onClick, icon, label }) => ( ); export default App;