import React from "react"; import bgImage from "../../assets/img/intro-carousel/bg1.jpg"; const LoginSection = ({ email, setEmail, otp, setOtp, otpSent, timer, error, loading, handleGenerateOtp, handleResendOtp, handleSubmit, }) => { return (
{/* Central Error Popup */} {error && (

{error}

)}

Login

{/* Email Input */}
setEmail(e.target.value)} required disabled={loading} style={styles.input} />
{/* Send OTP Button */} {!otpSent && ( )} {/* OTP Input and Buttons */} {otpSent && ( <>
setOtp(e.target.value)} required disabled={loading} style={styles.input} />
)}

Not registered?{" "} Register/Signup here

); }; /* Styles */ const styles = { container: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh", backgroundImage: `url(${bgImage})`, backgroundSize: "cover", backgroundPosition: "center", backgroundRepeat: "no-repeat", position: "relative", }, popup: { position: "absolute", top: "20px", left: "50%", transform: "translateX(-50%)", backgroundColor: "#f44336", //Default red color, will be overridden by condition color: "white", padding: "10px 20px", borderRadius: "8px", zIndex: 1000, boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.2)", fontWeight: "bold", }, popupText: { margin: 0, }, formContainer: { backgroundColor: "white", padding: "30px", borderRadius: "10px", boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", width: "400px", display: "flex", flexDirection: "column", }, headingContainer: { display: "flex", justifyContent: "flex-start", marginBottom: "20px", }, heading: { fontSize: "24px", fontWeight: "bold", color: "#5DDAB4", }, form: { display: "flex", flexDirection: "column", }, inputGroup: { marginBottom: "20px", }, label: { fontSize: "14px", fontWeight: "bold", marginBottom: "8px", display: "block", }, input: { width: "100%", padding: "12px", fontSize: "16px", border: "1px solid #ddd", borderRadius: "5px", marginTop: "5px", }, button: { padding: "12px", backgroundColor: "#033452", color: "white", border: "none", borderRadius: "5px", cursor: "pointer", marginTop: "15px", }, registerText: { textAlign: "center", marginTop: "20px", }, link: { color: "#007bff", textDecoration: "none", fontWeight: "bold", }, }; export default LoginSection;