'use client' import { useState } from 'react' import { useAuth } from '@/hooks/useAuth' export default function LoginModal({ onClose }: { onClose: () => void }) { const { login } = useAuth() const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState('') const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() try { await login(email, password) onClose() } catch (err: any) { setError(err.message || 'Login failed') } } return (