import React, { useState } from 'react'; import { Outlet, NavLink, useNavigate } from 'react-router-dom'; import { useAuthStore } from '../utils/store'; import { useTheme } from './ThemeProvider'; import { LayoutDashboard, Briefcase, TrendingUp, TrendingDown, Flame, Bell, LogOut, Menu, X, ChevronDown, User, Eye, ArrowLeftRight, BarChart3, Target, DollarSign, Newspaper, Brain, ArrowRightLeft, Trophy, GitCompare, Share2, Gauge, Sun, Moon, FileDown, Shield, SlidersHorizontal, Calculator, FileText, Scale, Zap, Search, BarChart2 } from 'lucide-react'; const Layout = () => { const [sidebarOpen, setSidebarOpen] = useState(false); const [userMenuOpen, setUserMenuOpen] = useState(false); const { user, logout } = useAuthStore(); const { theme, toggleTheme } = useTheme(); const navigate = useNavigate(); const handleLogout = () => { logout(); navigate('/login'); }; const navSections = [ { title: 'Invest', items: [ { path: '/top-picks', icon: Zap, label: 'Top Picks Today' }, { path: '/invest/analyze', icon: Search, label: 'Deep Analysis' }, { path: '/market-pulse', icon: BarChart2, label: 'Market Pulse' }, { path: '/profit-calc', icon: Calculator, label: 'Profit Calculator' }, ] }, { title: 'Portfolio', items: [ { path: '/dashboard', icon: LayoutDashboard, label: 'Dashboard' }, { path: '/portfolio', icon: Briefcase, label: 'Portfolio' }, { path: '/analytics', icon: BarChart3, label: 'Analytics' }, { path: '/risk', icon: Shield, label: 'Risk Analysis' }, { path: '/rebalance', icon: Scale, label: 'Rebalance' }, ] }, { title: 'Markets', items: [ { path: '/markets', icon: TrendingUp, label: 'Markets' }, { path: '/watchlist', icon: Eye, label: 'Watchlist' }, { path: '/screener', icon: SlidersHorizontal, label: 'Screener' }, { path: '/gainers', icon: Flame, label: 'Top Gainers' }, { path: '/losers', icon: TrendingDown, label: 'Top Losers' }, { path: '/news', icon: Newspaper, label: 'News Feed' }, { path: '/fear-greed', icon: Gauge, label: 'Fear & Greed' }, ] }, { title: 'Tools', items: [ { path: '/prediction', icon: Brain, label: 'AI Prediction' }, { path: '/dca', icon: Calculator, label: 'DCA Calculator' }, { path: '/converter', icon: ArrowRightLeft, label: 'Converter' }, { path: '/alerts', icon: Bell, label: 'Alerts' }, { path: '/compare', icon: GitCompare, label: 'Compare' }, ] }, { title: 'Finance', items: [ { path: '/transactions', icon: ArrowLeftRight, label: 'Transactions' }, { path: '/tax-report', icon: FileText, label: 'Tax Report' }, { path: '/goals', icon: Target, label: 'Goals' }, { path: '/dividends', icon: DollarSign, label: 'Dividends' }, ] }, { title: 'Social', items: [ { path: '/leaderboard', icon: Trophy, label: 'Leaderboard' }, { path: '/share', icon: Share2, label: 'Share Portfolio' }, ] }, ]; return (