From 47c6dd9e6224f3833f58dcfbd413a495b8c1cd0a Mon Sep 17 00:00:00 2001 From: Chandler Copeland Date: Thu, 19 Mar 2026 15:01:36 -0600 Subject: [PATCH] feat(02-02): add ContactSection client component and wire into homepage - Create src/app/_components/ContactSection.tsx: useActionState form with name, email, phone, message fields and gold Send Message button - Honeypot field (name="website") with display:none, tabIndex=-1, autoComplete="off" - Success state: form replaced by thank-you message on successful submission - Error state: inline alert for validation failures - page.tsx: replace
stub with - useActionState imported from 'react' (not react-dom, React 19 compatible) Co-Authored-By: Claude Sonnet 4.6 --- .../src/app/_components/ContactSection.tsx | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 teressa-copeland-homes/src/app/_components/ContactSection.tsx diff --git a/teressa-copeland-homes/src/app/_components/ContactSection.tsx b/teressa-copeland-homes/src/app/_components/ContactSection.tsx new file mode 100644 index 0000000..2acc938 --- /dev/null +++ b/teressa-copeland-homes/src/app/_components/ContactSection.tsx @@ -0,0 +1,77 @@ +'use client' +import { useActionState } from 'react' +import { submitContact, type ContactState } from '@/lib/contact-action' + +const initialState: ContactState = { status: 'idle' } + +export function ContactSection() { + const [state, action, pending] = useActionState(submitContact, initialState) + + return ( +
+
+

Get in Touch

+

+ Ready to find your Utah home? Teressa is here to help. +

+ + {state.status === 'success' ? ( +
+

+ Thanks! Teressa will be in touch soon. +

+
+ ) : ( +
+ {/* Honeypot — hidden from humans, bots fill it in */} + + + + + +