I created a layout component that receives the routes, but I am not able to leave the login separate from the dashboard
Routes
function AppRouter() {
return (
<Routes>
<Route path="/" element={<Navigate to="/dashboard" />} />
<Route path="/login" element={<Login />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/bookings" element={<Bookings />} />
<Route path="/sell-car" element={<SellCar />} />
<Route path="/settings" element={<Settings />} />
<Route path="*" element={<NotFound />} />
</Routes>
);
}
export default AppRouter;
Layout
const Layout = () => {
return (
<div className="layout">
<Sidebar />
<div className="main__layout">
<TopNav />
<div className="content">
<AppRouter />
</div>
</div>
</div>
);
};
export default Layout;
