'use client' import { useState } from 'react' import { CheckCircle2 } from 'lucide-react' type FormState = 'idle' | 'loading' | 'success' | 'error' const ACCENT = '#E61919' const ACCENT_DARK = '#B8140F' const ACCENT_SOFT = '#FDEEEC' export default function ContactForm() { const [state, setState] = useState('idle') const [form, setForm] = useState({ name: '', org: '', email: '', phone: '', _hp: '' }) const set = (k: keyof typeof form) => (e: React.ChangeEvent) => setForm(p => ({ ...p, [k]: e.target.value })) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() if (form._hp) return setState('loading') try { const res = await fetch('/api/contact', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: form.name, email: form.email, barNo: form.org, message: form.phone }), }) setState(res.ok ? 'success' : 'error') } catch { setState('error') } } if (state === 'success') { return (

Talebiniz alındı!

Kurucu ekipten kısa süre içinde size dönüş yapılacak.

) } const inputClass = 'w-full min-h-[46px] rounded-xl border-[1.5px] border-zinc-200 bg-white px-4 py-2.5 text-sm text-zinc-900 outline-none transition-colors focus:border-[var(--accent)]' return (
{state === 'error' && (
Bir hata oluştu. Lütfen tekrar deneyin veya{' '} info@ayris.tech adresine yazın.
)}
) }