This commit is contained in:
2025-04-30 14:23:08 -03:00
parent 142bcf410a
commit ca917438bf
3 changed files with 12 additions and 7 deletions

View File

@@ -1,9 +1,11 @@
import { Form, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { createElement } from "react";
import { createElement, useEffect } from "react";
import clsx from "clsx";
import { z } from "zod";
const N8N_URL = "https://n8n.eduseg.com.br/webhook/eduseg";
const schema = z.object({
name: z.string().nonempty({ message: "Deve preencher o nome" }),
email: z
@@ -15,14 +17,17 @@ const schema = z.object({
message: z.string().nonempty({ message: "Deve preencher a mensagem" }),
});
export default function Contact() {
export default function Contact({ url }) {
const { register, formState, control, reset } = useForm({
resolver: zodResolver(schema),
});
return (
<Form
action="https://n8n.eduseg.com.br/webhook/a377b3e0-b159-4536-98ab-e13822b60562"
action={N8N_URL}
onSubmit={(data) => {
return { url, ...data };
}}
onSuccess={() => reset()}
control={control}
className="flex flex-col gap-3"