import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import './index.css'
import './i18n'
import { ThemeProvider } from './contexts/ThemeContext'
import { ServerProvider } from './contexts/ServerContext'
import ScrollToTop from './components/ScrollToTop'
import App from './App.tsx'
import Friends from './pages/Friends.tsx'
import Blog from './pages/Blog.tsx'
import Servers from './pages/Servers.tsx'
import Forum from './pages/Forum.tsx'

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <ThemeProvider>
      <ServerProvider>
        <Router>
          <ScrollToTop />
          <Routes>
            <Route path="/" element={<App />} />
            <Route path="/friends" element={<Friends />} />
            <Route path="/blog" element={<Blog />} />
            <Route path="/servers" element={<Servers />} />
            <Route path="/forum" element={<Forum />} />
          </Routes>
        </Router>
      </ServerProvider>
    </ThemeProvider>
  </StrictMode>,
)
