import React, { useState, useEffect } from 'react';
import { useLocation, Link } from 'react-router-dom';
import {
LayoutDashboard,
TrendingUp,
BarChart3,
Bot,
Smile,
Activity,
DollarSign,
Newspaper,
Radio,
Monitor,
Settings,
HelpCircle,
ChevronLeft,
ChevronRight
} from 'lucide-react';
interface NavItem {
path: string;
label: string;
icon: React.ReactNode;
badge?: string;
section?: string;
}
const navItems: NavItem[] = [
// Main Section
{ path: '/', label: 'Dashboard', icon: , section: 'Main' },
{ path: '/market', label: 'Market', icon: },
{ path: '/charts', label: 'Charts', icon: },
// AI & Analysis Section
{ path: '/ai-models', label: 'AI Models', icon: , section: 'AI & Analysis' },
{ path: '/sentiment', label: 'Sentiment', icon: },
{ path: '/ai-analyst', label: 'AI Analyst', icon: },
{ path: '/technical-analysis', label: 'Technical', icon: },
// Trading Section
{ path: '/trading-assistant', label: 'Trading Assistant', icon: , section: 'Trading' },
{ path: '/news', label: 'News', icon: },
// System Section
{ path: '/providers', label: 'Providers', icon: , section: 'System' },
{ path: '/system-monitor', label: 'System Monitor', icon: , badge: 'LIVE' },
{ path: '/settings', label: 'Settings', icon: },
{ path: '/help', label: 'Help', icon: },
];
export const Sidebar: React.FC = () => {
const [collapsed, setCollapsed] = useState(false);
const location = useLocation();
useEffect(() => {
const savedState = localStorage.getItem('sidebar-collapsed');
if (savedState === 'true') {
setCollapsed(true);
}
}, []);
const toggleCollapse = () => {
const newState = !collapsed;
setCollapsed(newState);
localStorage.setItem('sidebar-collapsed', String(newState));
};
const isActive = (path: string) => {
if (path === '/' && location.pathname === '/') return true;
if (path !== '/' && location.pathname.startsWith(path)) return true;
return false;
};
let currentSection = '';
return (
);
};
export default Sidebar;