import { Link } from "react-router-dom"; import InstagramCover from "../../assets/images/instagram-icon-cover.png"; import { useState } from "react"; export default function Hero() { 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 (

Edgy your Instagram growth secret

Boost your popularity on Instagram with our premium package that will skyrocket your profile engagement!

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

Hold tight! Our representative will contact you shortly via email

) : (
{formError.email}

Start your free 14-day trial, no credit card necessary. By providing your email, you agree to our {" "} terms of service .

)}
); }