import React, { useState, useCallback } from 'react'; import LoginForm from './LoginForm'; import SignupForm from './SignupForm'; import OtpForm from './OtpForm'; import ForgotPasswordForm from './ForgotPasswordForm'; import ResetPasswordForm from './ResetPasswordForm'; const AuthPage = () => { const [view, setView] = useState('login'); // 'login', 'signup', 'otp', 'forgotPassword', 'resetPassword' const showSignup = useCallback(() => setView('signup'), []); const showLogin = useCallback(() => setView('login'), []); const showOtp = useCallback(() => setView('otp'), []); const showForgotPassword = useCallback(() => setView('forgotPassword'), []); const showResetPassword = useCallback(() => setView('resetPassword'), []); const renderForm = () => { switch (view) { case 'signup': return ; case 'otp': return ; case 'forgotPassword': return ; case 'resetPassword': return ; case 'login': default: return ; } }; return (
{renderForm()}
); }; export default AuthPage;