mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
34 lines
768 B
TypeScript
34 lines
768 B
TypeScript
import {
|
|
useNavigate,
|
|
useLocation,
|
|
Routes,
|
|
Route,
|
|
Navigate,
|
|
} from "react-router-dom";
|
|
import { DashboardLayout, type SidebarItem } from "@edr/ui-common";
|
|
|
|
import DashboardPage from "./pages/dashboard/DashboardPage";
|
|
|
|
const sidebarItems: SidebarItem[] = [{ label: "Dashboard", href: "/" }];
|
|
|
|
const App = () => {
|
|
const navigate = useNavigate();
|
|
const location = useLocation();
|
|
|
|
return (
|
|
<DashboardLayout
|
|
title="EDR Freight Backoffice"
|
|
sidebarItems={sidebarItems}
|
|
activeHref={location.pathname}
|
|
onNavigate={navigate}
|
|
>
|
|
<Routes>
|
|
<Route path="/" element={<DashboardPage />} />
|
|
<Route path="*" element={<Navigate to="/" replace />} />
|
|
</Routes>
|
|
</DashboardLayout>
|
|
);
|
|
};
|
|
|
|
export default App;
|