feat: Add Route Optimization to sidebar nav + App router
#33
by MouleeswaranM - opened
ops/AIsupplychain/aisupply/src/components/Sidebar.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
-
import { LayoutDashboard, BarChart3, FileText, FileSpreadsheet, Users, LogOut, Leaf, Package, ClipboardList, Navigation, Brain, Shield, Key, Layers } from 'lucide-react';
|
| 2 |
import { cn } from '../lib/utils';
|
| 3 |
import { NavLink } from 'react-router-dom';
|
| 4 |
|
| 5 |
const navItems = [
|
| 6 |
{ icon: LayoutDashboard, label: 'Dashboard', to: '/' },
|
| 7 |
{ icon: Brain, label: 'AI Fair Dispatch', to: '/fair-dispatch' },
|
|
|
|
| 8 |
{ icon: FileSpreadsheet, label: 'Absorption', to: '/absorption-requests' },
|
| 9 |
{ icon: Package, label: 'Packages', to: '/packages' },
|
| 10 |
{ icon: ClipboardList, label: 'Assign Tasks', to: '/assign-tasks' },
|
|
@@ -31,19 +32,19 @@ export function Sidebar() {
|
|
| 31 |
</div>
|
| 32 |
|
| 33 |
{/* Navigation */}
|
| 34 |
-
<nav className="flex-1 px-3 py-4 space-y-1">
|
| 35 |
{navItems.map((item) => (
|
| 36 |
<NavLink
|
| 37 |
key={item.to}
|
| 38 |
to={item.to}
|
| 39 |
className={({ isActive }) => cn(
|
| 40 |
-
"w-full flex items-center space-x-3 px-4 py-
|
| 41 |
isActive
|
| 42 |
? "bg-gradient-to-r from-orange-600 to-amber-500 text-white shadow-lg shadow-orange-600/20"
|
| 43 |
: "text-eco-text-secondary hover:bg-eco-secondary hover:text-white"
|
| 44 |
)}
|
| 45 |
>
|
| 46 |
-
<item.icon className={cn("w-5 h-5 transition-colors",
|
| 47 |
"group-[.active]:text-white"
|
| 48 |
)} />
|
| 49 |
<span>{item.label}</span>
|
|
@@ -53,8 +54,8 @@ export function Sidebar() {
|
|
| 53 |
|
| 54 |
{/* User Profile & Logout */}
|
| 55 |
<div className="p-4 border-t border-eco-card-border mt-auto">
|
| 56 |
-
<NavLink to="/admin" className="flex items-center space-x-3 mb-
|
| 57 |
-
<div className="w-
|
| 58 |
A
|
| 59 |
</div>
|
| 60 |
<div>
|
|
@@ -63,7 +64,7 @@ export function Sidebar() {
|
|
| 63 |
</div>
|
| 64 |
</NavLink>
|
| 65 |
<button className="flex items-center space-x-3 text-eco-text-secondary hover:text-white transition-colors px-2 py-2 w-full hover:bg-eco-secondary rounded-lg">
|
| 66 |
-
<LogOut className="w-
|
| 67 |
<span className="text-sm font-medium">Logout</span>
|
| 68 |
</button>
|
| 69 |
</div>
|
|
|
|
| 1 |
+
import { LayoutDashboard, BarChart3, FileText, FileSpreadsheet, Users, LogOut, Leaf, Package, ClipboardList, Navigation, Brain, Shield, Key, Layers, Route } from 'lucide-react';
|
| 2 |
import { cn } from '../lib/utils';
|
| 3 |
import { NavLink } from 'react-router-dom';
|
| 4 |
|
| 5 |
const navItems = [
|
| 6 |
{ icon: LayoutDashboard, label: 'Dashboard', to: '/' },
|
| 7 |
{ icon: Brain, label: 'AI Fair Dispatch', to: '/fair-dispatch' },
|
| 8 |
+
{ icon: Route, label: 'Route Optimizer', to: '/route-optimization' },
|
| 9 |
{ icon: FileSpreadsheet, label: 'Absorption', to: '/absorption-requests' },
|
| 10 |
{ icon: Package, label: 'Packages', to: '/packages' },
|
| 11 |
{ icon: ClipboardList, label: 'Assign Tasks', to: '/assign-tasks' },
|
|
|
|
| 32 |
</div>
|
| 33 |
|
| 34 |
{/* Navigation */}
|
| 35 |
+
<nav className="flex-1 px-3 py-4 space-y-1 overflow-y-auto custom-scrollbar">
|
| 36 |
{navItems.map((item) => (
|
| 37 |
<NavLink
|
| 38 |
key={item.to}
|
| 39 |
to={item.to}
|
| 40 |
className={({ isActive }) => cn(
|
| 41 |
+
"w-full flex items-center space-x-3 px-4 py-2.5 rounded-lg transition-all duration-200 group text-sm font-medium",
|
| 42 |
isActive
|
| 43 |
? "bg-gradient-to-r from-orange-600 to-amber-500 text-white shadow-lg shadow-orange-600/20"
|
| 44 |
: "text-eco-text-secondary hover:bg-eco-secondary hover:text-white"
|
| 45 |
)}
|
| 46 |
>
|
| 47 |
+
<item.icon className={cn("w-4.5 h-4.5 transition-colors",
|
| 48 |
"group-[.active]:text-white"
|
| 49 |
)} />
|
| 50 |
<span>{item.label}</span>
|
|
|
|
| 54 |
|
| 55 |
{/* User Profile & Logout */}
|
| 56 |
<div className="p-4 border-t border-eco-card-border mt-auto">
|
| 57 |
+
<NavLink to="/admin" className="flex items-center space-x-3 mb-3 px-2 hover:bg-eco-secondary/50 p-2 rounded-lg transition-colors group">
|
| 58 |
+
<div className="w-9 h-9 rounded-full bg-gradient-to-br from-orange-600 to-amber-500 flex items-center justify-center text-white font-bold text-sm group-hover:shadow-neon-orange transition-all">
|
| 59 |
A
|
| 60 |
</div>
|
| 61 |
<div>
|
|
|
|
| 64 |
</div>
|
| 65 |
</NavLink>
|
| 66 |
<button className="flex items-center space-x-3 text-eco-text-secondary hover:text-white transition-colors px-2 py-2 w-full hover:bg-eco-secondary rounded-lg">
|
| 67 |
+
<LogOut className="w-4 h-4" />
|
| 68 |
<span className="text-sm font-medium">Logout</span>
|
| 69 |
</button>
|
| 70 |
</div>
|