'use client' import { useState } from 'react' import { submitContactMessageAction } from '@/app/actions' import HoneypotField from '@/components/HoneypotField' interface Translations { name: string email: string subject: string message: string submit: string sending: string success: string } interface FormProps { translations: Translations } export default function ContactForm({ translations }: FormProps) { const [success, setSuccess] = useState(false) const [error, setError] = useState('') const [loading, setLoading] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setLoading(true) setError('') const formData = new FormData(e.currentTarget) try { const res = await submitContactMessageAction(formData) if (res.error) { setError(res.error) } else { setSuccess(true) e.currentTarget.reset() } } catch (err) { setError('Bir hata oluştu. Lütfen tekrar deneyin.') } finally { setLoading(false) } } if (success) { return (

teşekkürler!

{translations.success}

) } return (
{error && (
{error}
)} {/* Name */}
{/* Email */}
{/* Subject */}
{/* Message */}