File size: 4,622 Bytes
db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 8964497 db2ad38 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | import React from 'react';
import { NavLink } from 'react-router-dom';
const NAV_ITEMS = [
{ to: '/', icon: 'smart_toy', label: 'AI Agent', desc: 'LangGraph Agent' },
{ to: '/dark-store-intel', icon: 'warehouse', label: 'Store Intel', desc: 'Tobit Forecast' },
{ to: '/route-intelligence', icon: 'alt_route', label: 'Route Intel', desc: 'Kalman & Dispatch' },
{ to: '/ml-guard', icon: 'security', label: 'ML Guard', desc: 'Fraud Protection' },
{ to: '/analytics', icon: 'analytics', label: 'Analytics', desc: 'Command Center' },
];
export default function Sidebar() {
return (
<aside style={styles.sidebar}>
{/* Brand Title */}
<div style={styles.brandBox}>
<div style={styles.logoBadge}>H</div>
<div>
<div style={styles.brandName}>HyperFlow</div>
<div style={styles.brandSub}>Commerce Intelligence</div>
</div>
</div>
<div style={styles.divider} />
{/* Navigation */}
<nav style={styles.nav}>
{NAV_ITEMS.map(item => (
<NavLink
key={item.to}
to={item.to}
end={item.to === '/'}
style={({ isActive }) => ({
...styles.navCard,
...(isActive ? styles.navCardActive : {}),
})}
>
{({ isActive }) => (
<>
<div style={{
...styles.iconBox,
background: isActive ? 'var(--accent-gradient)' : 'rgba(255, 255, 255, 0.03)',
borderColor: isActive ? 'transparent' : 'var(--bg-border)',
boxShadow: isActive ? '0 4px 14px var(--accent-coral-glow)' : 'none',
}}>
<span
className="material-symbols-outlined"
style={{ fontSize: 18, color: isActive ? '#FFF' : 'var(--text-secondary)' }}
>
{item.icon}
</span>
</div>
<div style={styles.navText}>
<div style={{
...styles.navLabel,
color: isActive ? '#FFF' : 'var(--text-secondary)',
fontWeight: isActive ? 700 : 500,
}}>
{item.label}
</div>
<div style={styles.navDesc}>{item.desc}</div>
</div>
</>
)}
</NavLink>
))}
</nav>
</aside>
);
}
const styles = {
sidebar: {
width: 220,
flexShrink: 0,
background: 'rgba(14, 12, 18, 0.7)',
backdropFilter: 'blur(20px)',
borderRight: '1px solid var(--bg-border)',
display: 'flex',
flexDirection: 'column',
padding: '20px 14px',
gap: 16,
},
brandBox: {
display: 'flex',
alignItems: 'center',
gap: 12,
padding: '4px 6px',
},
logoBadge: {
width: 34,
height: 34,
borderRadius: 10,
background: 'var(--accent-gradient)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontFamily: 'var(--font-serif)',
fontSize: 18,
fontWeight: 700,
color: '#FFF',
boxShadow: '0 4px 16px var(--accent-coral-glow)',
},
brandName: {
fontFamily: 'var(--font-serif)',
fontSize: 18,
fontWeight: 700,
color: '#FFF',
letterSpacing: '-0.01em',
},
brandSub: {
fontFamily: 'var(--font-sans)',
fontSize: 10,
color: 'var(--text-muted)',
marginTop: 1,
},
divider: {
height: 1,
background: 'var(--bg-border)',
margin: '0 4px',
},
nav: {
display: 'flex',
flexDirection: 'column',
gap: 8,
},
navCard: {
display: 'flex',
alignItems: 'center',
gap: 12,
padding: '10px 12px',
borderRadius: 'var(--radius-md)',
textDecoration: 'none',
transition: 'all 0.2s ease',
background: 'transparent',
border: '1px solid transparent',
},
navCardActive: {
background: 'rgba(255, 51, 102, 0.08)',
borderColor: 'rgba(255, 51, 102, 0.2)',
},
iconBox: {
width: 32,
height: 32,
borderRadius: 10,
border: '1px solid var(--bg-border)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
transition: 'all 0.2s ease',
},
navText: {
flex: 1,
minWidth: 0,
},
navLabel: {
fontFamily: 'var(--font-sans)',
fontSize: 13,
letterSpacing: '-0.01em',
},
navDesc: {
fontFamily: 'var(--font-sans)',
fontSize: 10,
color: 'var(--text-muted)',
marginTop: 1,
},
};
|