import {BrowserRouter, Routes, Route} from 'react-router-dom'
import Home from './pages/Home'
import Login from './pages/Login'
import SignUp from './pages/SignUp'
import Contact from './pages/Contact'
import {Profile} from './pages/Profile'
import Navbar from './components/Navbar'
import PrivateRoute from './components/PrivateRoute'
import CreatListing from './pages/CreatListing'
import UpdateListing from './pages/UpdateListing'
import Listing from './pages/Listing'
import SearchProperties from './pages/SearchProperties'
import Footer from './components/Footer'
import Agent from './pages/Agent'


const App = () => {
  return (
    <BrowserRouter>
    <Navbar/>
      <Routes>
        <Route path='/' element={<Home/>}/>
        <Route element={<PrivateRoute/>}>
          <Route path='/profile' element={<Profile/>}/>
          <Route path='/createListing' element={<CreatListing/>}/>
          <Route path='/updateListing/:listingId' element={<UpdateListing/>}/>
        </Route>
        <Route path='/listing/:listingId' element={<Listing/>}/>
        <Route path='/search' element={<SearchProperties/>}/>
        <Route path='/login' element={<Login/>}/>
        <Route path='/signup' element={<SignUp/>}/>
        <Route path='/contact' element={<Contact/>}/>
        <Route path='/contact-agent' element={<Agent/>}/>
      </Routes>
      <Footer/>
    </BrowserRouter>
  )
}

export default App
