Auth Component - TSX
Auth Component - TSX
useEffect(() => {
// Automatically focus the first input when the page changes
if (inputRef.current) {
inputRef.current.focus();
}
}, [currentPage]);
return (
<div className="min-h-screen flex items-center justify-center bg-gray-100 p-4">
<div className="w-full max-w-md bg-white p-6 rounded-lg shadow-md">
<h1 className="text-2xl font-bold text-center mb-6 text-blue-600">
{currentPage === 'login' ? 'Welcome Back' : 'Create Account'}
</h1>
{currentPage === 'login' ? <LoginForm /> : <SignupForm />}
</div>
</div>
);
};