From 3c36b5f9ad5a5299776802620578d5b5e2562f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Rafael=20Siqueira?= Date: Tue, 22 Apr 2025 10:37:01 -0300 Subject: [PATCH] add form --- superpage/src/pages/[slug].astro | 8 +++++ superpage/src/pages/_components/Contact.Astro | 35 +++++++++++++++++++ superpage/src/pages/_components/_input.astro | 7 ++++ superpage/src/pages/_components/_label.astro | 3 ++ .../src/pages/_components/_textarea.astro | 8 +++++ 5 files changed, 61 insertions(+) create mode 100644 superpage/src/pages/_components/_input.astro create mode 100644 superpage/src/pages/_components/_label.astro create mode 100644 superpage/src/pages/_components/_textarea.astro diff --git a/superpage/src/pages/[slug].astro b/superpage/src/pages/[slug].astro index 9d74663..c4b6c38 100644 --- a/superpage/src/pages/[slug].astro +++ b/superpage/src/pages/[slug].astro @@ -9,6 +9,7 @@ import Semeq from '~/components/logos/Semeq.astro' import Natura from '~/components/logos/Natura.astro' import Nissan from '~/components/logos/Nissan.astro' import Manserv from '~/components/logos/Manserv.astro' +import Contact from './_components/Contact.astro' import placeholder from './_assets/placeholder.png' import mulherdenegocios from './_assets/mulher-de-negocios.png' @@ -276,5 +277,12 @@ const trainer = data.course?.trainer ? await getEntry(data.course?.trainer) : nu + + + + + + + diff --git a/superpage/src/pages/_components/Contact.Astro b/superpage/src/pages/_components/Contact.Astro index e69de29..d603871 100644 --- a/superpage/src/pages/_components/Contact.Astro +++ b/superpage/src/pages/_components/Contact.Astro @@ -0,0 +1,35 @@ +--- +import Label from './_label.astro' +import Input from './_input.astro' +import Textarea from './_textarea.astro' + +// https://n8n.eduseg.com.br/webhook/a377b3e0-b159-4536-98ab-e13822b60562 + +if (Astro.request.method === 'POST') { + try { + const data = await Astro.request.formData() + console.log(data) + } catch (error) { + if (error instanceof Error) { + console.error(error.message) + } + } +} +--- + +
+ + +