2025-04-14 14:25:41 -07:00
|
|
|
// AppRouter
|
|
|
|
|
|
|
|
|
|
// Development Components
|
|
|
|
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
|
|
|
|
// Components
|
|
|
|
|
import Header from "../components/Header";
|
|
|
|
|
import Footer from "../components/Footer";
|
2025-04-16 12:02:42 -07:00
|
|
|
import ProtectedRoute from "../components/ProtectedRoute";
|
2025-04-14 14:25:41 -07:00
|
|
|
// Pages
|
2025-04-16 12:02:42 -07:00
|
|
|
import HomePage from "../pages/HomePage";
|
|
|
|
|
import LoginPage from "../pages/LoginPage";
|
2025-04-17 10:10:04 -07:00
|
|
|
import PageCodeEditor from "../pages/CodeEditor";
|
2025-04-14 14:25:41 -07:00
|
|
|
import PageNotFound from "../pages/PageNotFound";
|
|
|
|
|
|
2025-04-16 12:02:42 -07:00
|
|
|
const AppRouter = () => {
|
2025-04-14 14:25:41 -07:00
|
|
|
return (
|
|
|
|
|
<BrowserRouter>
|
|
|
|
|
<div className="wrapper">
|
|
|
|
|
<Header />
|
|
|
|
|
<Routes>
|
2025-04-16 12:02:42 -07:00
|
|
|
<Route path="/login" element={<LoginPage />} />
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<HomePage />
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-04-17 10:10:04 -07:00
|
|
|
<Route
|
|
|
|
|
path="/editor"
|
|
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<PageCodeEditor />
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-04-14 14:25:41 -07:00
|
|
|
<Route path="*" element={<PageNotFound />} />
|
|
|
|
|
</Routes>
|
|
|
|
|
<Footer />
|
|
|
|
|
</div>
|
|
|
|
|
</BrowserRouter>
|
|
|
|
|
);
|
2025-04-16 12:02:42 -07:00
|
|
|
};
|
2025-04-14 14:25:41 -07:00
|
|
|
|
|
|
|
|
export default AppRouter;
|