import { useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { useAuth } from '../../contexts/AuthContext'; import { LayoutDashboard, Zap, Building2, Landmark, FileText, Shield, CheckSquare, Settings, LogOut, ChevronLeft, ChevronRight, Bell, User, Copy, ExternalLink, ChevronDown, GitBranch } from 'lucide-react'; const navItems = [ { id: 'dashboard', label: 'Overview', icon: LayoutDashboard, path: '/dashboard' }, { id: 'transaction-builder', label: 'Transaction Builder', icon: Zap, path: '/transaction-builder' }, { id: 'transactions', label: 'Transactions', icon: GitBranch, path: '/transactions' }, { id: 'accounts', label: 'Accounts', icon: Building2, path: '/accounts' }, { id: 'treasury', label: 'Treasury', icon: Landmark, path: '/treasury' }, { id: 'reporting', label: 'Reporting', icon: FileText, path: '/reporting' }, { id: 'compliance', label: 'Compliance & Risk', icon: Shield, path: '/compliance' }, { id: 'settlements', label: 'Settlements', icon: CheckSquare, path: '/settlements' }, ]; interface PortalLayoutProps { children: React.ReactNode; } export default function PortalLayout({ children }: PortalLayoutProps) { const { user, wallet, disconnect } = useAuth(); const navigate = useNavigate(); const location = useLocation(); const [collapsed, setCollapsed] = useState(false); const [showUserMenu, setShowUserMenu] = useState(false); const [showNotifications, setShowNotifications] = useState(false); const currentPath = location.pathname; const copyAddress = () => { if (wallet?.address) { navigator.clipboard.writeText(wallet.address); } }; return (
navigate('/dashboard')}> {!collapsed && (
Solace Bank Group PLC
)}
Production
{showNotifications && (
Notifications
AML Alert
Unusual pattern on ACC-001
Settlement Confirmed
TX-2024-0847 settled
Report Ready
Q4 IFRS Balance Sheet
)}
{showUserMenu && (
Account
{wallet?.address ? `${wallet.address.slice(0, 8)}...${wallet.address.slice(-6)}` : '—'}
{wallet?.balance ? `${parseFloat(wallet.balance).toFixed(4)} ETH` : '—'} Chain {wallet?.chainId || 1}
)}
{children}
); }