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 (

Social Task Messenger

The world's first encrypted task messenger

Built with anycoder
setEmail(e.target.value)} className="w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent" placeholder="Enter your email" required />
setPassword(e.target.value)} className="w-full pl-10 pr-12 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent" placeholder="Enter your password" required />
{error && (
{error}
)}
Or continue with
) }