diff --git a/src/app/contactus/page.tsx b/src/app/contactus/page.tsx new file mode 100644 index 00000000..41fe8719 --- /dev/null +++ b/src/app/contactus/page.tsx @@ -0,0 +1,281 @@ +'use client'; + +import { useState } from 'react'; +import { Mail, Clock, Send, CheckCircle } from 'lucide-react'; +import { siteConfig } from '@/config/siteConfig'; +import { MagneticText } from '@/components/ui/magnetic-text'; + +const subjectOptions = [ + { value: '', label: 'Select Subject' }, + { value: 'general', label: 'General Inquiry' }, + { value: 'support', label: 'Technical Support' }, + { value: 'feature', label: 'Feature Request' }, + { value: 'bug', label: 'Bug Report' }, + { value: 'partnership', label: 'Partnership / Collaboration' }, + { value: 'feedback', label: 'Feedback' }, + { value: 'other', label: 'Other' }, +]; + +export default function ContactUsPage() { + const [formData, setFormData] = useState({ + name: '', + email: '', + subject: '', + message: '', + }); + + const [isSubmitting, setIsSubmitting] = useState(false); + const [isSubmitted, setIsSubmitted] = useState(false); + const [error, setError] = useState(''); + + const handleChange = ( + e: React.ChangeEvent< + HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement + > + ) => { + setFormData({ ...formData, [e.target.name]: e.target.value }); + if (error) setError(''); + }; + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + if ( + !formData.name || + !formData.email || + !formData.subject || + !formData.message + ) { + setError('Please fill in all required fields.'); + return; + } + + setIsSubmitting(true); + setError(''); + + try { + // TODO: Replace with real API call later + // Example: await fetch('/api/contact', { method: 'POST', body: JSON.stringify(formData) }); + + console.log('Contact form submitted:', formData); + + // Simulate API delay + await new Promise((resolve) => setTimeout(resolve, 1200)); + + setIsSubmitted(true); + setFormData({ name: '', email: '', subject: '', message: '' }); + } catch (err) { + setError('Something went wrong. Please try again later.'); + } finally { + setIsSubmitting(false); + } + }; + + const resetForm = () => { + setIsSubmitted(false); + setError(''); + }; + + return ( +
+ Have questions? Need help? Or want to collaborate?
+
+ We’re here for you.
+
+ Your message has been received. We’ll get back to you within + 24-48 hours. +
+ ++ Our support team typically responds within 24-48 business hours. +
+Email Us
+ + {siteConfig.contact.email} + +Response Time
++ 24 - 48 hours +
+Follow us on
+ +