import { useTranslation } from "react-i18next"; import { FaMapMarkerAlt, FaPhoneAlt, FaEnvelope, FaWhatsapp, FaPaperPlane, } from "react-icons/fa"; import emailjs from "@emailjs/browser"; import { useRef, useState } from "react"; import { motion } from "framer-motion"; const Contact = () => { const { t } = useTranslation(); const form = useRef(); const [message, setMessage] = useState({ text: "", type: "" }); const [isLoading, setIsLoading] = useState(false); const sendEmail = (e) => { e.preventDefault(); setIsLoading(true); setMessage({ text: "", type: "" }); emailjs .sendForm( "service_cqcqipd", "template_o7xejbn", form.current, "_JAFEi75xtLgmGaNi" ) .then( (result) => { console.log("Message sent:", result.text); setMessage({ text: t("contact.successMessage") || "Message sent successfully!", type: "success", }); form.current.reset(); setIsLoading(false); setTimeout(() => setMessage({ text: "", type: "" }), 5000); }, (error) => { console.error("Failed to send message:", error.text); setMessage({ text: t("contact.errorMessage") || "Failed to send message. Please try again.", type: "error", }); setIsLoading(false); setTimeout(() => setMessage({ text: "", type: "" }), 5000); } ); }; return (

{t("contact.title")}

{t("contact.address")}

{t("contact.addressText")}

{t("contact.email")}

Info@rexnt.com

{t("contact.formTitle")}

{message.text && (
{message.type === "success" ? ( ) : ( )} {message.text}
)}
{isLoading ? ( <> {t("contact.send")}... ) : ( <> {t("contact.send")} )} {!isLoading && (
)}

{t('contact.contactSection.title')}

{t('contact.contactSection.description')}

{t('contact.contactSection.badges', { returnObjects: true }).map((badge, index) => ( {badge} ))}
); }; export default Contact;