import { useState } from 'react'; import { useNavigate, Link, useSearchParams } from 'react-router-dom'; import { useAuthStore } from '../../store/authStore'; import { Blocks, Eye, EyeOff, Mail, Lock } from 'lucide-react'; import GoogleButton from './GoogleButton'; export default function LoginForm() { const [searchParams] = useSearchParams(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const { login, loading, error, clearError } = useAuthStore(); const navigate = useNavigate(); const urlError = searchParams.get('error'); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); try { await login(email, password); navigate('/dashboard'); } catch {} }; return (
Sign in to your account