import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'

import { HomePage, AddPage, LoginPage, UserPage } from './pages'
import { WithToken } from './components'

import 'leaflet/dist/leaflet.css'
import './App.css'

function App() {
  return (
    <Router>
      <Routes>
        <Route index element={<HomePage />} />
        <Route path='/add' element={
          <WithToken>
            <AddPage />
          </WithToken>
        } />
        <Route path='/user' element={
          <WithToken>
            <UserPage />
          </WithToken>
        } />
        <Route path='/login' element={<LoginPage />} />
      </Routes>
    </Router>
  )
}

export default App
