diff --git a/src/app/[locale]/support/page.tsx b/src/app/[locale]/support/page.tsx index 42e924d..229e900 100644 --- a/src/app/[locale]/support/page.tsx +++ b/src/app/[locale]/support/page.tsx @@ -13,21 +13,29 @@ import { useState } from "react"; const Support = () => { const [isSent, setIsSent] = useState(false); - + const [userName, setUserName] = useState(""); + const [phone, setPhone] = useState(""); + const [email, setEmail] = useState(""); + const [message, setMessage] = useState(""); + const handleSubmit: React.MouseEventHandler< HTMLFormElement > = async (e) => { e.preventDefault(); - const formData = new FormData(e.currentTarget); - console.log(formData); + const data = { + name: userName, + phone: phone, + email: email, + message: email + }; + try { - /* + const res = await apiInstance.post( - `/${endpoint}/${id}/reviews/`, - formData, - config - );*/ + "/support/", + data + ); } catch (error) { console.log(error); } @@ -35,6 +43,12 @@ const Support = () => { }; + function buttonIsActive() + { + return message === "" || userName === ""; + } + + return (