import React, {useRef, useState} from "react"; import {motion} from "framer-motion"; import emailjs from "@emailjs/browser"; import {styles} from "../styles"; import {SectionWrapper} from "../hoc"; import {slideIn} from "../utils/motion"; import EarthCanvas from "./canvas/Earth.jsx"; const Contact = () => { const formRef = useRef(); const [form, setForm] = useState({ name: "", email: "", message: "", }); const [loading, setLoading] = useState(false); const handleChange = (e) => { const {target} = e; const {name, value} = target; setForm({ ...form, [name]: value, }); }; const handleSubmit = (e) => { e.preventDefault(); setLoading(true); emailjs .send( import.meta.env.VITE_APP_EMAILJS_SERVICE_ID, import.meta.env.VITE_APP_EMAILJS_TEMPLATE_ID, { from_name: form.name, to_name: "JJ", from_email: form.email, to_email: "Jwizzed@outlook.com", message: form.message, }, import.meta.env.VITE_APP_EMAILJS_PUBLIC_KEY ) .then( () => { setLoading(false); alert("Thank you. I will get back to you as soon as possible."); setForm({ name: "", email: "", message: "", }); }, (error) => { setLoading(false); console.error(error); alert("Ahh, something went wrong. Please try again."); } ); }; return (

มีปัญหาปรึกษาพี่

Contact.