import React, { useState } from 'react'; // import { useNavigate } from 'react-router-dom'; import { useWallet } from '@/contexts/WalletContext'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import TokenSwap from '@/components/TokenSwap'; import PoolDashboard from '@/components/PoolDashboard'; import { CreatePoolModal } from './CreatePoolModal'; import { InitializeHezPoolModal } from './InitializeHezPoolModal'; import { ArrowRightLeft, Droplet, Settings } from 'lucide-react'; import { isFounderWallet } from '@pezkuwi/utils/auth'; export const DEXDashboard: React.FC = () => { const { account } = useWallet(); const [activeTab, setActiveTab] = useState('swap'); // Admin modal states const [showCreatePoolModal, setShowCreatePoolModal] = useState(false); const [showInitializeHezPoolModal, setShowInitializeHezPoolModal] = useState(false); const isFounder = account ? isFounderWallet(account) : false; const handleCreatePool = () => { setShowCreatePoolModal(true); }; const handleModalClose = () => { setShowCreatePoolModal(false); setShowInitializeHezPoolModal(false); }; const handleSuccess = async () => { // Pool modals will refresh their own data }; return (
{/* Header */}

Pezkuwi DEX

Decentralized exchange for trading tokens on PezkuwiChain

{/* Wallet status */} {account && (
Connected: {account.slice(0, 6)}...{account.slice(-4)}
{isFounder && (
FOUNDER ACCESS
)}
)}
{/* Main content */}
{!account ? (
Please connect your Polkadot wallet to use the DEX
) : ( Swap Pools {isFounder && ( Admin )} {isFounder && (

Token Wrapping

Convert native HEZ to wrapped wHEZ for use in DEX pools

Pool Management

Create new liquidity pools for token pairs on PezkuwiChain

Pool Statistics

View detailed pool statistics in the Pools tab

)}
)}
{/* Admin Modals */}
); };