2026-01-11 17:35:46 -06:00
|
|
|
import React, { useState } from "react";
|
|
|
|
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
|
|
|
|
|
2026-01-11 17:35:33 -06:00
|
|
|
import Sidebar from "./components/Sidebar";
|
|
|
|
|
import Topbar from "./components/Topbar";
|
2026-01-20 15:05:00 -06:00
|
|
|
import Dashboard from "./pages/Dashboard";
|
2025-08-11 19:13:42 -05:00
|
|
|
|
2026-01-11 17:35:46 -06:00
|
|
|
// CONTACTS
|
|
|
|
|
import ContactsList from "./pages/contacts/list/List";
|
|
|
|
|
import ContactFormPage from "./pages/contacts/form/ContactFormPage";
|
|
|
|
|
|
|
|
|
|
// ACCOUNTS
|
|
|
|
|
import AccountList from "./pages/accounts/list/List";
|
2026-01-20 15:05:00 -06:00
|
|
|
import AccountFormPage from "./pages/accounts/form/AccountFormPage";
|
2026-01-11 17:35:46 -06:00
|
|
|
|
|
|
|
|
// EMPLOYEES
|
|
|
|
|
import EmployeeList from "./pages/employees/list/List";
|
2026-01-20 15:05:00 -06:00
|
|
|
import EmployeeFormPage from "./pages/employees/form/EmployeeFormPage";
|
|
|
|
|
|
|
|
|
|
// LOCATIONS
|
|
|
|
|
import LocationsList from "./pages/locations/list/List";
|
|
|
|
|
import LocationFormPage from "./pages/locations/form/LocationFormPage";
|
|
|
|
|
|
|
|
|
|
// WORK ORDERS
|
|
|
|
|
import WorkOrdersList from "./pages/workorders/list/List";
|
|
|
|
|
import WorkOrderFormPage from "./pages/workorders/form/WorkOrderFormPage";
|
2026-01-11 17:35:46 -06:00
|
|
|
|
|
|
|
|
// FOLLOW UPS
|
|
|
|
|
import FollowUpList from "./pages/followup/list/List";
|
2026-01-20 15:05:00 -06:00
|
|
|
import FollowUpFormPage from "./pages/followup/form/FollowUpFormPage";
|
2026-01-11 17:35:46 -06:00
|
|
|
|
|
|
|
|
// PM SCHEDULES
|
|
|
|
|
import PMScheduleList from "./pages/PmSchedule/list/List";
|
2026-01-20 15:05:00 -06:00
|
|
|
import PMScheduleFormPage from "./pages/PmSchedule/form/PmScheduleFormPage";
|
2026-01-11 17:35:33 -06:00
|
|
|
|
|
|
|
|
export default function App() {
|
2026-01-11 17:35:46 -06:00
|
|
|
const [navCollapsed, setNavCollapsed] = useState(false);
|
|
|
|
|
|
2025-08-11 19:13:42 -05:00
|
|
|
return (
|
2026-01-11 17:35:46 -06:00
|
|
|
<BrowserRouter>
|
|
|
|
|
<div className={`app ${navCollapsed ? "nav-collapsed" : ""}`}>
|
|
|
|
|
<Sidebar />
|
|
|
|
|
|
|
|
|
|
<div className="mainArea">
|
|
|
|
|
<Topbar onToggleNav={() => setNavCollapsed(v => !v)} />
|
|
|
|
|
|
|
|
|
|
<div className="contentWrapper">
|
|
|
|
|
<Routes>
|
2026-01-20 15:05:00 -06:00
|
|
|
<Route path="/" element={<Dashboard />} />
|
|
|
|
|
<Route path="/dashboard" element={<Dashboard />} />
|
2026-01-11 17:35:46 -06:00
|
|
|
|
2026-01-20 15:05:00 -06:00
|
|
|
{/* CONTACTS */}
|
2026-01-11 17:35:46 -06:00
|
|
|
<Route path="/contacts" element={<ContactsList />} />
|
|
|
|
|
<Route path="/contacts/new" element={<ContactFormPage />} />
|
2026-01-20 15:05:00 -06:00
|
|
|
<Route path="/contacts/edit/:id" element={<ContactFormPage />} />
|
2026-01-11 17:35:46 -06:00
|
|
|
|
2026-01-20 15:05:00 -06:00
|
|
|
{/* ACCOUNTS */}
|
2026-01-11 17:35:46 -06:00
|
|
|
<Route path="/accounts" element={<AccountList />} />
|
2026-01-20 15:05:00 -06:00
|
|
|
<Route path="/accounts/new" element={<AccountFormPage />} />
|
|
|
|
|
<Route path="/accounts/edit/:id" element={<AccountFormPage />} />
|
2026-01-11 17:35:46 -06:00
|
|
|
|
2026-01-20 15:05:00 -06:00
|
|
|
{/* EMPLOYEES */}
|
2026-01-11 17:35:46 -06:00
|
|
|
<Route path="/employees" element={<EmployeeList />} />
|
2026-01-20 15:05:00 -06:00
|
|
|
<Route path="/employees/new" element={<EmployeeFormPage />} />
|
|
|
|
|
<Route path="/employees/edit/:id" element={<EmployeeFormPage />} />
|
|
|
|
|
|
|
|
|
|
{/* LOCATIONS */}
|
|
|
|
|
<Route path="/locations" element={<LocationsList />} />
|
|
|
|
|
<Route path="/locations/new" element={<LocationFormPage />} />
|
|
|
|
|
<Route path="/locations/edit/:id" element={<LocationFormPage />} />
|
|
|
|
|
|
|
|
|
|
{/* WORK ORDERS */}
|
|
|
|
|
<Route path="/workorders" element={<WorkOrdersList />} />
|
|
|
|
|
<Route path="/workorders/new" element={<WorkOrderFormPage />} />
|
|
|
|
|
<Route path="/workorders/edit/:id" element={<WorkOrderFormPage />} />
|
2026-01-11 17:35:46 -06:00
|
|
|
|
|
|
|
|
{/* FOLLOW UPS */}
|
|
|
|
|
<Route path="/followups" element={<FollowUpList />} />
|
2026-01-20 15:05:00 -06:00
|
|
|
<Route path="/followups/new" element={<FollowUpFormPage />} />
|
|
|
|
|
<Route path="/followups/edit/:id" element={<FollowUpFormPage />} />
|
2026-01-11 17:35:46 -06:00
|
|
|
|
|
|
|
|
{/* PM SCHEDULES */}
|
|
|
|
|
<Route path="/pmschedules" element={<PMScheduleList />} />
|
2026-01-20 15:05:00 -06:00
|
|
|
<Route path="/pmschedules/new" element={<PMScheduleFormPage />} />
|
|
|
|
|
<Route path="/pmschedules/edit/:id" element={<PMScheduleFormPage />} />
|
2026-01-11 17:35:46 -06:00
|
|
|
</Routes>
|
|
|
|
|
</div>
|
2026-01-11 17:35:33 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-11 17:35:46 -06:00
|
|
|
</BrowserRouter>
|
2025-08-11 19:13:42 -05:00
|
|
|
);
|
2026-01-11 17:35:46 -06:00
|
|
|
}
|