aboutsummaryrefslogtreecommitdiffstats
path: root/panel/src/components/PrivateRoute.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'panel/src/components/PrivateRoute.jsx')
-rw-r--r--panel/src/components/PrivateRoute.jsx23
1 files changed, 15 insertions, 8 deletions
diff --git a/panel/src/components/PrivateRoute.jsx b/panel/src/components/PrivateRoute.jsx
index 04e00f7..2160f74 100644
--- a/panel/src/components/PrivateRoute.jsx
+++ b/panel/src/components/PrivateRoute.jsx
@@ -1,10 +1,17 @@
-import React from 'react';
-import { Navigate, Outlet } from 'react-router-dom';
-import { useAuth } from '../contexts/AuthContext';
+import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
+import LoginPage from '../pages/LoginPage';
+import Dashboard from '../pages/Dashboard'; // Assuming you have a Dashboard component
-const PrivateRoute = () => {
- const { currentUser } = useAuth();
- return currentUser ? <Outlet /> : <Navigate to="/login" />;
-};
+function App() {
+ return (
+ <Router>
+ <Routes>
+ <Route path="/login" element={<LoginPage />} />
+ <Route path="/dashboard" element={<Dashboard />} />
+ {/* Other routes */}
+ </Routes>
+ </Router>
+ );
+}
-export default PrivateRoute;
+export default App;