import React from 'react'; import { useWeb3 } from '../context/Web3Context'; import { Wallet, TrendingUp, Compass, PieChart, ShieldAlert, CheckCircle2 } from 'lucide-react'; interface NavbarProps { activeTab: string; setActiveTab: (tab: string) => void; } export const WebNavbar: React.FC = ({ activeTab, setActiveTab }) => { const { account, wusdBalance, isCorrectNetwork, connectWallet, switchNetwork } = useWeb3(); const navs = [ { id: 'explore', label: '🔥 市场探索', icon: Compass }, { id: 'trade', label: '⚡ 交易终端', icon: TrendingUp }, { id: 'portfolio', label: '💼 我的持仓与账本', icon: PieChart }, ]; return (
{/* Logo & Navigation */}
setActiveTab('explore')}>
W
WTFX POWER LDA
{/* Right Section / Wallet Status */}
{account ? (
{!isCorrectNetwork ? ( ) : (
可用: {Number(wusdBalance).toLocaleString(undefined, { maximumFractionDigits: 2 })} WUSD
)}
{account.slice(0, 6)}...{account.slice(-4)}
) : ( )}
); };