'use client'; import { useState } from 'react'; export default function ContactPage() { const [loading, setLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const [error, setError] = useState(''); const [formData, setFormData] = useState({ firstName: '', lastName: '', email: '', subject: '', message: '', }); const handleChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormData(prev => ({ ...prev, [name]: value })); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(''); try { const response = await fetch('/api/contact', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(formData), }); if (response.ok) { setSubmitted(true); setFormData({ firstName: '', lastName: '', email: '', subject: '', message: '' }); setTimeout(() => setSubmitted(false), 5000); } else { const data = await response.json(); setError(data.message || 'Failed to send message. Please try again.'); } } catch (err) { setError('An error occurred. Please try again later.'); console.error(err); } finally { setLoading(false); } }; return (

Have some questions?

Get in touch with our team

We’ll help you choose the right webinar and guide you through planning your next steps.

Contact details

Reach out directly or send a message using the form.

📧

Email

support@estateplanning.com

📞

Phone

+1 (555) 123-4567

📍

Office

123 Main St, Suite 100

Map preview coming soon
{submitted && (
✓ Thank you for your message! We'll get back to you soon.
)} {error && (
✗ {error}
)}