aboutsummaryrefslogblamecommitdiffstats
path: root/panel/src/App.jsx
blob: 6d88aaf5e839562006f3a7bab914a1935e18dddb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
                          
                                                           













                                                      










                                                             




                   
import React from 'react';
import { Route, Routes, Navigate } from 'react-router-dom';
import LoginPage from './pages/LoginPage';
import RegisterPage from './pages/RegisterPage';
import ResetPage from './pages/ResetPage';
import Dashboard from './pages/Dashboard';
import ManageAds from './pages/ManageAds';
import Roles from './pages/Roles';
import PrivateRoute from './components/PrivateRoute';
import { AuthProvider } from './contexts/AuthContext';
import 'bootstrap/dist/css/bootstrap.min.css';
import './tailwind.css';

function App() {
  return (
    <AuthProvider>
      <Routes>
        <Route path="/" element={<Navigate to="/login" />} />
        <Route path="/login" element={<LoginPage />} />
        <Route path="/register" element={<RegisterPage />} />
        <Route path="/reset" element={<ResetPage />} />
        <Route path="/" element={<PrivateRoute />}>
          <Route path="dashboard" element={<Dashboard />} />
          <Route path="manage-ads" element={<ManageAds />} />
          <Route path="roles" element={<Roles />} />
        </Route>
      </Routes>
    </AuthProvider>
  );
}

export default App;