import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import './index.css';
import App from './App.jsx';
import History from './pages/History.jsx';
import Settings from './pages/Settings.jsx';

createRoot(document.getElementById('jbot-root')).render(
  <StrictMode>
    {/* basename="/jbot" so React Router matches /jbot/history, /jbot/settings etc. */}
    <BrowserRouter basename="/jbot">
      <Routes>
        <Route path="/" element={<App />} />
        <Route path="/history" element={<History />} />
        <Route path="/settings" element={<Settings />} />
      </Routes>
    </BrowserRouter>
  </StrictMode>,
);
