"use client" import pb from "@/lib/pocketbase" import { contactUsValidationSchema } from "@/utils/form" import { yupResolver } from "@hookform/resolvers/yup" import React from "react" import { useForm } from "react-hook-form" import { toast } from "react-toastify" const FormLeftDescriptionRightContactUs = () => { const { register, handleSubmit, formState: { errors } } = useForm({ resolver: yupResolver(contactUsValidationSchema) }) const onSubmit = async data => { try { await pb.collection("contact").create({ source: "contactus", ...data }) localStorage.setItem("contactus", JSON.stringify(data)) } catch (error) { if (error instanceof Error) { toast.error(error.message, { position: "bottom-left", autoClose: 5000, hideProgressBar: false, closeOnClick: true, pauseOnHover: true, draggable: true, progress: undefined, theme: "colored" }) } } } return ( <> {/* Contact Us */}
We have received your details and will be in touch!
)}