import { Outlet, NavLink } from 'react-router-dom'; import { LayoutDashboard, Send, Download, History, Settings, Lock, Wifi, WifiOff, Server, Hammer, FileCode2, Coins, Image, PiggyBank, ArrowLeftRight, Users, Globe, Usb, Shield, BarChart3, QrCode, HardDrive, Cloud, Globe2, Cpu, Database, EyeOff, GitBranch, Vote, Layers, Eye, ListPlus, Activity, Timer, ShieldCheck, // Phase 7-16 icons UserX, Shuffle, ArrowUpDown, TrendingUp, PieChart, Bell, Terminal, Wrench, Puzzle, } from 'lucide-react'; import { useState } from 'react'; import { useWalletStore } from '../store/wallet'; import { useNodeStore } from '../store/node'; import { useMiningStore, formatHashrate } from '../store/mining'; import { NotificationsBell } from './NotificationsPanel'; import { WalletSelector } from './WalletSelector'; import { CreateWalletModal } from './CreateWalletModal'; import { ImportWalletModal } from './ImportWalletModal'; const navItems = [ { to: '/dashboard', label: 'Dashboard', icon: LayoutDashboard }, { to: '/send', label: 'Send', icon: Send }, { to: '/batch-send', label: 'Batch Send', icon: ListPlus }, { to: '/receive', label: 'Receive', icon: Download }, { to: '/history', label: 'History', icon: History }, ]; const defiNavItems = [ { to: '/staking', label: 'Staking', icon: PiggyBank }, { to: '/swap', label: 'Swap', icon: ArrowLeftRight }, { to: '/market', label: 'Market', icon: BarChart3 }, ]; const advancedNavItems = [ { to: '/node', label: 'Node', icon: Server }, { to: '/mining', label: 'Mining', icon: Hammer }, { to: '/contracts', label: 'Contracts', icon: FileCode2 }, { to: '/tokens', label: 'Tokens', icon: Coins }, { to: '/nfts', label: 'NFTs', icon: Image }, ]; const infrastructureNavItems = [ { to: '/storage', label: 'Storage', icon: Cloud }, { to: '/hosting', label: 'Hosting', icon: Globe2 }, { to: '/compute', label: 'Compute', icon: Cpu }, { to: '/database', label: 'Database', icon: Database }, ]; const privacyBridgeNavItems = [ { to: '/privacy', label: 'Privacy', icon: EyeOff }, { to: '/bridge', label: 'Bridge', icon: GitBranch }, ]; const governanceNavItems = [ { to: '/governance', label: 'Governance', icon: Vote }, { to: '/zk', label: 'ZK-Rollup', icon: Layers }, ]; const toolsNavItems = [ { to: '/watch-only', label: 'Watch-Only', icon: Eye }, { to: '/fee-analytics', label: 'Fee Analytics', icon: Activity }, { to: '/vaults', label: 'Time Vaults', icon: Timer }, { to: '/recovery', label: 'Recovery', icon: ShieldCheck }, { to: '/decoy', label: 'Decoy Wallets', icon: UserX }, { to: '/mixer', label: 'Mixer', icon: Shuffle }, { to: '/limit-orders', label: 'Limit Orders', icon: ArrowUpDown }, { to: '/yield', label: 'Yield', icon: TrendingUp }, { to: '/portfolio', label: 'Portfolio', icon: PieChart }, { to: '/alerts', label: 'Alerts', icon: Bell }, { to: '/cli', label: 'CLI', icon: Terminal }, { to: '/rpc-profiles', label: 'RPC Profiles', icon: Server }, { to: '/tx-builder', label: 'Tx Builder', icon: Wrench }, { to: '/plugins', label: 'Plugins', icon: Puzzle }, { to: '/dapps', label: 'DApps', icon: Globe }, { to: '/addressbook', label: 'Address Book', icon: Users }, { to: '/multisig', label: 'Multi-sig', icon: Shield }, { to: '/hardware', label: 'Hardware', icon: Usb }, { to: '/qr', label: 'QR Code', icon: QrCode }, { to: '/backup', label: 'Backup', icon: HardDrive }, { to: '/settings', label: 'Settings', icon: Settings }, ]; export default function Layout() { const { lockWallet, balance } = useWalletStore(); const nodeStatus = useNodeStore((state) => state.status); const miningStatus = useMiningStore((state) => state.status); // Modal state for multi-wallet management const [showCreateModal, setShowCreateModal] = useState(false); const [showImportModal, setShowImportModal] = useState(false); const handleLock = async () => { await lockWallet(); }; const renderNavSection = ( items: typeof navItems, title?: string ) => ( <> {title && (

{title}

)} {items.map(({ to, label, icon: Icon }) => ( `flex items-center justify-between px-4 py-2.5 rounded-lg transition-colors ${ isActive ? 'bg-synor-600 text-white' : 'text-gray-400 hover:text-white hover:bg-gray-800' }` } >
{label}
{/* Status indicators */} {to === '/node' && nodeStatus.isConnected && ( )} {to === '/mining' && miningStatus.isMining && ( {formatHashrate(miningStatus.hashrate)} )}
))} ); return (
{/* Sidebar */} {/* Main content */}
{/* Multi-wallet Modals */} {showCreateModal && ( setShowCreateModal(false)} /> )} {showImportModal && ( setShowImportModal(false)} /> )}
); }