import React, { useState } from 'react' import { useAuth } from '../../contexts/AuthContext' export const MetaMaskConnect: React.FC = () => { const [isConnecting, setIsConnecting] = useState(false) const { login } = useAuth() const connectWallet = async () => { setIsConnecting(true) try { if (!window.ethereum) { alert('MetaMask not installed!') return } const accounts = await window.ethereum.request({ method: 'eth_requestAccounts', }) if (accounts.length > 0) { // Simplified login for now await login(accounts[0], '', '') } } catch (error) { console.error('Connection failed:', error) } finally { setIsConnecting(false) } } return ( ) }