import animationCharCome from "@/lib/utils/animationCharCome"; import animationWordCome from "@/lib/utils/animationWordCome"; import { useEffect, useRef, useState } from "react"; import { toast } from 'react-hot-toast'; const Contact1 = () => { const charAnim = useRef(); const wordAnim = useRef(); useEffect(() => { animationCharCome(charAnim.current); animationWordCome(wordAnim.current); }, []); const [formData, setFormData] = useState({ timestamp: new Date().toLocaleString() + "", name: "", email: "", phone: "", subject: "", message: "", sheetId: process.env.NEXT_PUBLIC_CONTACT_SHEET_ID }); const handleChange = (e) => { setFormData({ ...formData, [e.target.name]: e.target.value, }); }; const handleSubmit = async (e) => { e.preventDefault(); try { toast.loading('Sending your message to our experts...') await fetch("/api/sheets/contacts-sheet", { method: "POST", body: JSON.stringify(formData), headers: { "Content-Type": "application/json", }, }); setFormData({ timestamp: new Date().toLocaleString() + "", name: "", email: "", phone: "", subject: "", message: "", }) toast.dismiss(); toast.success('Our experts have successfully received your message!'); } catch (error) { toast.error('Opps! Something Went Wrong...') console.error("Error submitting form:", error); } }; return ( <>

Let’s get in touch

{ "We're excited to hear from you and start something special togerter." }

{"Book your demo now! "}

); }; export default Contact1;