'use client'; import Image from 'next/image'; import Link from 'next/link'; import { useState, useEffect } from 'react'; import { CommonHeader } from '@/components/layout/CommonHeader'; import { Footer } from '@/components/layout/Footer'; import { cmsService } from '@/services/cms.service'; interface ContactDetails { title: string; description: string; email: string; phone: string; phoneHours: string; officeAddress: string; officeCity: string; mapUrl: string; directionsUrl: string; } interface ContactCta { title: string; description: string; buttonText: string; buttonLink: string; } const defaultContactDetails: ContactDetails = { title: 'Get In Touch', description: 'Have a question about a property or need assistance? Fill out the form below and our team will get back to you shortly.', email: '123support@gmail.com', phone: '1234567890', phoneHours: 'Mon-Fri 9am-6pm', officeAddress: '123 Market Street', officeCity: 'New York CA 234737', mapUrl: '', directionsUrl: '', }; const defaultCta: ContactCta = { title: 'Ready to find an agent?', description: 'Discover trusted agents and start your property journey with confidence.', buttonText: 'Start Your Search', buttonLink: '/user/profiles', }; export default function ContactPage() { const [formData, setFormData] = useState({ name: '', phone: '', email: '', message: '', }); const [contactDetails, setContactDetails] = useState(defaultContactDetails); const [cta, setCta] = useState(defaultCta); useEffect(() => { const loadCms = async () => { const [details, ctaData] = await Promise.all([ cmsService.getSectionContent('contact', 'contactDetails'), cmsService.getSectionContent('contact', 'cta'), ]); if (details) setContactDetails({ ...defaultContactDetails, ...details }); if (ctaData) setCta({ ...defaultCta, ...ctaData }); }; loadCms(); }, []); const handleInputChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormData(prev => ({ ...prev, [name]: value })); }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); // Handle form submission console.log('Form submitted:', formData); }; const handleCancel = () => { setFormData({ name: '', phone: '', email: '', message: '' }); }; return (
{/* Header */}
{/* Main Content */}
{/* Contact Section */}
{/* Title */}

{contactDetails.title}

{contactDetails.description}

{/* Contact Form */}
{/* Your Name */}
{/* Phone Number */}
Phone
{/* Email Address */}
Email
{/* Message */}