diff options
Diffstat (limited to 'src/main.jsx')
-rw-r--r-- | src/main.jsx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main.jsx b/src/main.jsx new file mode 100644 index 0000000..3de432c --- /dev/null +++ b/src/main.jsx @@ -0,0 +1,38 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; // Import from 'react-dom/client' +import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import './index.css'; +import App from './App'; +import Login from './pages/Login'; +import Register from './pages/Register'; +import Dashboard from './pages/Dashboard'; +import ManageAds from './pages/ManageAds'; +import PrivateRoute from './utils/PrivateRoute'; + +const rootElement = document.getElementById('root'); +const root = ReactDOM.createRoot(rootElement); // Create a root + +root.render( + <Router> + <Routes> + <Route path="/" element={<Login />} /> + <Route path="/register" element={<Register />} /> + <Route + path="/dashboard" + element={ + <PrivateRoute> + <Dashboard /> + </PrivateRoute> + } + /> + <Route + path="/manage-ads" + element={ + <PrivateRoute> + <ManageAds /> + </PrivateRoute> + } + /> + </Routes> + </Router> +); |