import { useState } from 'react' import { useFirebase } from './FirebaseProvider' import { Mail, Lock, Google, Eye, EyeOff } from 'lucide-react' export default function Auth() { const [isSignUp, setIsSignUp] = useState(false) const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [showPassword, setShowPassword] = useState(false) const [error, setError] = useState('') const [loading, setLoading] = useState(false) const { signInWithGoogle, signInWithEmail, signUpWithEmail } = useFirebase() const handleSubmit = async (e) => { e.preventDefault() setError('') setLoading(true) try { if (isSignUp) { await signUpWithEmail(email, password) } else { await signInWithEmail(email, password) } } catch (error) { setError(error.message || 'An error occurred') } finally { setLoading(false) } } const handleGoogleSignIn = async () => { setLoading(true) await signInWithGoogle() setLoading(false) } return (