import React, { useState } from "react"; import { Link } from "react-router-dom"; export default function Newsletter() { const [formValue, setFormValue] = useState({ email: "" }); const [formError, setFormError] = useState({}); const [submit, setSubmit] = useState(false); const [loading, setLoading] = useState(false); const ResetLocation = () => window.scrollTo(0, 0); const handleSubmit = async (e) => { e.preventDefault(); setLoading(true); setFormError(validateForm(formValue)); if (Object.keys(validateForm(formValue)).length > 0) { setLoading(false); return null; } else { setSubmit(true); setFormValue({ email: "" }); setLoading(false); } }; const handleValidation = (e) => { const { name, value } = e.target; setFormValue({ ...formValue, [name]: value }); }; const validateForm = (value) => { const errors = {}; const emailValidation = /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/; if (!value.email) { errors.email = "Empty email field"; } else if (!emailValidation.test(value.email)) { errors.email = "Invalid email format"; } return errors; }; return (

Sign up for our newsletter

Subscribe to our newsletter to receive the latest updates, exclusive offers, and valuable insights. Join our community of forward-thinkers and never miss out on exciting news again. Simply enter your email below and be part of the conversation!

{loading ? (
Loading...
) : submit && Object.keys(formError).length === 0 ? (

Hold tight! Our representative will contact you shortly via email

) : (
{formError.email}
)}

We care about the protection of your data. Read our{" "} Privacy Policy.

); }