'use client'; import React, { useState } from 'react'; import { Mail, Phone, Loader2 } from 'lucide-react'; import { validateEmail, sendContactFormEmail } from '../src/utils/email'; import { analytics } from '../src/utils/analytics'; export function ContactClient() { const [formData, setFormData] = useState({ name: '', email: '', phone: '', company: '', message: '' }); const [submitted, setSubmitted] = useState(false); const [sending, setSending] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setSending(true); setError(null); try { // Validate email if (!validateEmail(formData.email)) { throw new Error('Please enter a valid email address'); } // Send via SMTP backend await sendContactFormEmail(formData, 'contact'); setSubmitted(true); analytics.event('contact', 'form_submitted'); // Reset form after delay setTimeout(() => { setFormData({ name: '', email: '', phone: '', company: '', message: '' }); setSubmitted(false); }, 3000); } catch (err) { setError(err instanceof Error ? err.message : 'Failed to send message. Please try again.'); analytics.error(err as Error, 'Contact form submission failed'); } finally { setSending(false); } }; const handleChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormData(prev => ({ ...prev, [name]: value })); }; return (

Contact Us

Ready to start your sustainability journey? Get in touch with our team today.

Get in Touch

Have questions about our carbon offsetting solutions? Our team is here to help you make a difference in maritime sustainability.

{submitted && (

Thank you for your message. Your email client will open shortly.

)} {error && (

{error}

)}

* Required fields

); }