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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useState } from 'react';
|
| 2 |
+
import { Mail, Phone, MapPin, Send } from 'lucide-react';
|
| 3 |
+
|
| 4 |
+
export default function Contact() {
|
| 5 |
+
const [formData, setFormData] = useState({
|
| 6 |
+
name: '',
|
| 7 |
+
email: '',
|
| 8 |
+
company: '',
|
| 9 |
+
message: ''
|
| 10 |
+
});
|
| 11 |
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
| 12 |
+
const [submitStatus, setSubmitStatus] = useState(null);
|
| 13 |
+
|
| 14 |
+
const handleChange = (e) => {
|
| 15 |
+
setFormData({
|
| 16 |
+
...formData,
|
| 17 |
+
[e.target.name]: e.target.value
|
| 18 |
+
});
|
| 19 |
+
};
|
| 20 |
+
|
| 21 |
+
const handleSubmit = async (e) => {
|
| 22 |
+
e.preventDefault();
|
| 23 |
+
setIsSubmitting(true);
|
| 24 |
+
setSubmitStatus(null);
|
| 25 |
+
|
| 26 |
+
try {
|
| 27 |
+
const response = await fetch('/api/contact', {
|
| 28 |
+
method: 'POST',
|
| 29 |
+
headers: {
|
| 30 |
+
'Content-Type': 'application/json',
|
| 31 |
+
},
|
| 32 |
+
body: JSON.stringify(formData),
|
| 33 |
+
});
|
| 34 |
+
|
| 35 |
+
if (response.ok) {
|
| 36 |
+
setSubmitStatus('success');
|
| 37 |
+
setFormData({ name: '', email: '', company: '', message: '' });
|
| 38 |
+
} else {
|
| 39 |
+
setSubmitStatus('error');
|
| 40 |
+
}
|
| 41 |
+
} catch (error) {
|
| 42 |
+
setSubmitStatus('error');
|
| 43 |
+
} finally {
|
| 44 |
+
setIsSubmitting(false);
|
| 45 |
+
}
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
return (
|
| 49 |
+
<section id="contact" className="py-20 bg-white">
|
| 50 |
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 51 |
+
<div className="text-center mb-16">
|
| 52 |
+
<h2 className="text-3xl sm:text-4xl font-bold text-gray-900 mb-4">
|
| 53 |
+
Ready to Get Started?
|
| 54 |
+
</h2>
|
| 55 |
+
<p className="text-xl text-gray-600 max-w-3xl mx-auto">
|
| 56 |
+
Let's discuss how we can accelerate your vector database implementation
|
| 57 |
+
</p>
|
| 58 |
+
</div>
|
| 59 |
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-12">
|
| 60 |
+
<div>
|
| 61 |
+
<h3 className="text-2xl font-semibold text-gray-900 mb-6">Get in Touch</h3>
|
| 62 |
+
<div className="space-y-6">
|
| 63 |
+
<div className="flex items-start space-x-4">
|
| 64 |
+
<Mail className="w-6 h-6 text-primary-600 mt-1" />
|
| 65 |
+
<div>
|
| 66 |
+
<h4 className="font-semibold text-gray-900">Email</h4>
|
| 67 |
+
<p className="text-gray-600">hello@chromavector.com</p>
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
<div className="flex items-start space-x-4">
|
| 71 |
+
<Phone className="w-6 h-6 text-primary-600 mt-1" />
|
| 72 |
+
<div>
|
| 73 |
+
<h4 className="font-semibold text-gray-900">Phone</h4>
|
| 74 |
+
<p className="text-gray-600">+1 (555) 123-4567</p>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
<div className="flex items-start space-x-4">
|
| 78 |
+
<MapPin className="w-6 h-6 text-primary-600 mt-1" />
|
| 79 |
+
<div>
|
| 80 |
+
<h4 className="font-semibold text-gray-900">Office</h4>
|
| 81 |
+
<p className="text-gray-600">San Francisco, CA<br />New York, NY<br />London, UK</p>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
| 86 |
+
<div>
|
| 87 |
+
<form onSubmit={handleSubmit} className="space-y-6">
|
| 88 |
+
<div>
|
| 89 |
+
<label htmlFor="name" className="block text-sm font-medium text-gray-700 mb-2">
|
| 90 |
+
Name *
|
| 91 |
+
</label>
|
| 92 |
+
<input
|
| 93 |
+
type="text"
|
| 94 |
+
id="name"
|
| 95 |
+
name="name"
|
| 96 |
+
required
|
| 97 |
+
value={formData.name}
|
| 98 |
+
onChange={handleChange}
|
| 99 |
+
className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-600 focus:border-transparent"
|
| 100 |
+
placeholder="Your name"
|
| 101 |
+
/>
|
| 102 |
+
</div>
|
| 103 |
+
<div>
|
| 104 |
+
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-2">
|
| 105 |
+
Email *
|
| 106 |
+
</label>
|
| 107 |
+
<input
|
| 108 |
+
type="email"
|
| 109 |
+
id="email"
|
| 110 |
+
name="email"
|
| 111 |
+
required
|
| 112 |
+
value={formData.email}
|
| 113 |
+
onChange={handleChange}
|
| 114 |
+
className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-600 focus:border-transparent"
|
| 115 |
+
placeholder="your@email.com"
|
| 116 |
+
/>
|
| 117 |
+
</div>
|
| 118 |
+
<div>
|
| 119 |
+
<label htmlFor="company" className="block text-sm font-medium text-gray-700 mb-2">
|
| 120 |
+
Company
|
| 121 |
+
</label>
|
| 122 |
+
<input
|
| 123 |
+
type="text"
|
| 124 |
+
id="company"
|
| 125 |
+
name="company"
|
| 126 |
+
value={formData.company}
|
| 127 |
+
onChange={handleChange}
|
| 128 |
+
className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-600 focus:border-transparent"
|
| 129 |
+
placeholder="Your company"
|
| 130 |
+
/>
|
| 131 |
+
</div>
|
| 132 |
+
<div>
|
| 133 |
+
<label htmlFor="message" className="block text-sm font-medium text-gray-700 mb-2">
|
| 134 |
+
Message *
|
| 135 |
+
</label>
|
| 136 |
+
<textarea
|
| 137 |
+
id="message"
|
| 138 |
+
name="message"
|
| 139 |
+
required
|
| 140 |
+
rows="4"
|
| 141 |
+
value={formData.message}
|
| 142 |
+
onChange={handleChange}
|
| 143 |
+
className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-600 focus:border-transparent"
|
| 144 |
+
placeholder="Tell us about your project..."
|
| 145 |
+
/>
|
| 146 |
+
</div>
|
| 147 |
+
<button
|
| 148 |
+
type="submit"
|
| 149 |
+
disabled={isSubmitting}
|
| 150 |
+
className="w-full bg-primary-600 text-white py-3 rounded-lg font-semibold hover:bg-primary-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center gap-2"
|
| 151 |
+
>
|
| 152 |
+
{isSubmitting ? (
|
| 153 |
+
<>
|
| 154 |
+
<div className="w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" />
|
| 155 |
+
Sending...
|
| 156 |
+
</>
|
| 157 |
+
) : (
|
| 158 |
+
<>
|
| 159 |
+
<Send className="w-5 h-5" />
|
| 160 |
+
Send Message
|
| 161 |
+
</>
|
| 162 |
+
)}
|
| 163 |
+
</button>
|
| 164 |
+
{submitStatus === 'success' && (
|
| 165 |
+
<div className="bg-green-50 border border-green-200 text-green-800 px-4 py-3 rounded-lg">
|
| 166 |
+
Thank you! We'll get back to you within 24 hours.
|
| 167 |
+
</div>
|
| 168 |
+
)}
|
| 169 |
+
{submitStatus === 'error' && (
|
| 170 |
+
<div className="bg-red-50 border border-red-200 text-red-800 px-4 py-3 rounded-lg">
|
| 171 |
+
Something went wrong. Please try again or email us directly.
|
| 172 |
+
</div>
|
| 173 |
+
)}
|
| 174 |
+
</form>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
</div>
|
| 178 |
+
</section>
|
| 179 |
+
);
|
| 180 |
+
}
|