'use client'; import { useState } from 'react'; import { signInWithEmailAndPassword } from 'firebase/auth'; import { auth } from '@/lib/firebase'; import { useRouter } from 'next/navigation'; export default function Login() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const router = useRouter(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); setError(''); try { await signInWithEmailAndPassword(auth, email, password); router.push('/dashboard'); } catch (err: any) { setError(err.message); } }; return (