import React from 'react';
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
import Header from './components/Header';
import Footer from './components/Footer';
import HomePage from './pages/HomePage';
import TournamentPage from './pages/TournamentPage';
import SchedulePage from './pages/SchedulePage';
import GamePage from './pages/GamePage';
import QuestionnairePage from './pages/QuestionnairePage';
import ResultsPage from './pages/ResultsPage';
import PastPage from './pages/PastPage';

export default function App() {
  return (
    <BrowserRouter>
      <div className="app">
        <Header />
        <Routes>
          <Route path="/" element={<Navigate to="/tournament/fujarna-14-3-2026" replace />} />
          <Route path="/tournament/:id" element={<TournamentPage />} />
          <Route path="/tournament/:id/schedule" element={<SchedulePage />} />
          <Route path="/tournament/:id/game/:gid" element={<GamePage />} />
          <Route path="/tournament/:id/questionnaire" element={<QuestionnairePage />} />
          <Route path="/tournament/:id/results" element={<ResultsPage />} />
          <Route path="/past" element={<PastPage />} />
        </Routes>
        <Footer />
      </div>
    </BrowserRouter>
  );
}
