import React, { useState } from 'react'; import { Wallet, Chrome, Smartphone, Copy, Check, ExternalLink } from 'lucide-react'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { useWallet } from '@/contexts/WalletContext'; import { formatAddress } from '@/lib/wallet'; interface WalletModalProps { isOpen: boolean; onClose: () => void; } export const WalletModal: React.FC = ({ isOpen, onClose }) => { const { connectMetaMask, connectWalletConnect, isConnected, address } = useWallet(); const [copied, setCopied] = useState(false); const handleCopyAddress = () => { if (address) { navigator.clipboard.writeText(address); setCopied(true); setTimeout(() => setCopied(false), 2000); } }; const handleMetaMaskConnect = async () => { await connectMetaMask(); if (isConnected) onClose(); }; const handleWalletConnectConnect = async () => { await connectWalletConnect(); }; return ( Connect Wallet Connect your wallet to interact with PezkuwiChain governance {!isConnected ? ( Browser Wallet Mobile Wallet
Don't have MetaMask?{' '} Download here
Scan QR code with your mobile wallet to connect
) : (
Connected Address
{formatAddress(address!)}
)}
); };