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

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

import WithToken from './components/WithToken'

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 /> */}
            <h1>For Yet Go <Link to="/">Home</Link></h1>
          </WithToken>
        } />
        <Route path="/login" element={<LoginPage />} />
      </Routes>
    </Router>
  )
}

export default App
