import React, { useState } from 'react'; interface EmailAuthFormProps { type: 'signup' | 'login'; onSubmit: (data: { email: string; password: string }) => void; isLoading: boolean; error?: string; } const EmailAuthForm: React.FC = ({ type, onSubmit, isLoading, error }) => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onSubmit({ email, password }); }; return (

{type === 'signup' ? 'Create your account' : 'Sign in to your account'}

{type === 'signup' ? 'Join us today and organize your week' : 'Welcome back! Please enter your details'}

{error && (
{error}
)}
setEmail(e.target.value)} className="appearance-none block w-full pl-10 px-4 py-3 border border-gray-300 rounded-lg placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder="you@example.com" />
setPassword(e.target.value)} className="appearance-none block w-full pl-10 px-4 py-3 border border-gray-300 rounded-lg placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder="••••••••" />

Password must be at least 8 characters

); }; export default EmailAuthForm;