'use client'; import * as React from 'react'; import { m, LazyMotion, domAnimation } from 'framer-motion'; import { Button } from '@/components/ui/Button'; import { sendContactFormAction } from '@/app/actions/contact'; export function ContactForm() { const [status, setStatus] = React.useState<'idle' | 'loading' | 'success' | 'error'>('idle'); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setStatus('loading'); const formData = new FormData(e.currentTarget); try { const result = await sendContactFormAction(formData); if (result.success) { setStatus('success'); } else { setStatus('error'); } } catch (error) { console.error(error); setStatus('error'); } }; return (
{/* Decorative accent */}

Projektanfrage stellen

Hinterlassen Sie uns Ihre Kontaktdaten und Details zu Ihrem Vorhaben. Wir melden uns umgehend bei Ihnen.

{status === 'success' ? (

Anfrage erfolgreich gesendet

Vielen Dank für Ihr Interesse an der E-TIB Gruppe. Ein Ansprechpartner wird sich zeitnah mit Ihnen in Verbindung setzen.

) : status === 'error' ? (

Fehler beim Senden

Leider ist ein Fehler aufgetreten. Bitte versuchen Sie es später noch einmal oder kontaktieren Sie uns direkt per E-Mail oder Telefon.

) : null} {status !== 'success' && status !== 'error' && (