"use client"; import api from "@/service/api"; import { useForm } from "react-hook-form"; import { toast } from "react-toastify"; import InputGroup from "../_components/InputGroup"; type TContactUsForm = { full_name: string; company_name: string; work_email: string; phone_number: string; }; const ContactUsForm = () => { const { register, handleSubmit, formState: { errors }, } = useForm(); const onSubmit = async (data: TContactUsForm) => { try { const response = (await api.post("inquiries", { ...data })).data; toast.success(response.message); } catch (error) { console.log(error); toast.error("Something went wrong"); throw error; } }; return (
); }; export default ContactUsForm;