import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { App } from './App';
import './index.css';

// Vite's BASE_URL reflects the configured base path (VITE_BASE).
// In dev: '/'. In prod with VITE_BASE=/splint/: '/splint/'.
// React Router needs the basename to prefix all client-side routes.
const BASENAME = import.meta.env.BASE_URL || '/';

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <BrowserRouter basename={BASENAME}>
      <App />
    </BrowserRouter>
  </React.StrictMode>
);
