mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 05:18:11 +00:00
Project Initialization
This commit is contained in:
29
apps/edr-freight-web/backoffice/src/App.tsx
Normal file
29
apps/edr-freight-web/backoffice/src/App.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user