import { Routes, Route, Navigate } from 'react-router-dom'
import Home from './pages/Home'
import Lobby from './pages/Lobby'
import Game from './pages/Game'
import Results from './pages/Results'
import Replay from './pages/Replay'
import { AdminLayout, Login, Dashboard, Questions, Calendar } from './pages/admin'

function App() {
  return (
    <div className="min-h-screen">
      <Routes>
        {/* Game routes */}
        <Route path="/" element={<Home />} />
        <Route path="/lobby/:roomCode" element={<Lobby />} />
        <Route path="/game/:roomCode" element={<Game />} />
        <Route path="/results/:roomCode" element={<Results />} />
        <Route path="/replay/:replayCode" element={<Replay />} />

        {/* Admin routes */}
        <Route path="/admin/login" element={<Login />} />
        <Route path="/admin" element={<AdminLayout />}>
          <Route index element={<Navigate to="dashboard" replace />} />
          <Route path="dashboard" element={<Dashboard />} />
          <Route path="questions" element={<Questions />} />
          <Route path="calendar" element={<Calendar />} />
        </Route>
      </Routes>
    </div>
  )
}

export default App
