import React, { useState } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
import GameApp from './game/GameApp.jsx';
import './index.css';

function Root() {
  const [mode, setMode] = useState('game'); // 'game' | 'sandbox'

  if (mode === 'sandbox') {
    return <App onSwitchToGame={() => setMode('game')} />;
  }

  return <GameApp onSwitchToSandbox={() => setMode('sandbox')} />;
}

createRoot(document.getElementById('root')).render(<Root />);
