diff --git a/src/app/contact/page.tsx b/src/app/contact/page.tsx index c0fcc32..05088ea 100644 --- a/src/app/contact/page.tsx +++ b/src/app/contact/page.tsx @@ -2,9 +2,48 @@ import Image from 'next/image'; import Link from 'next/link'; -import { useState } from 'react'; +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({ @@ -14,6 +53,21 @@ export default function ContactPage() { 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 })); @@ -43,10 +97,10 @@ export default function ContactPage() { {/* Title */}

- Get In Touch + {contactDetails.title}

- Have a question about a property or need assistance? Fill out the form below and our team will get back to you shortly. + {contactDetails.description}

@@ -177,7 +231,7 @@ export default function ContactPage() { Email Support

- 123support@gmail.com + {contactDetails.email}

@@ -198,10 +252,10 @@ export default function ContactPage() { Phone

- 1234567890 + {contactDetails.phone}

- Mon-Fri 9am-6pm + {contactDetails.phoneHours}

@@ -222,10 +276,10 @@ export default function ContactPage() { Office

- 123 Market Street + {contactDetails.officeAddress}

- New York CA 234737 + {contactDetails.officeCity}

@@ -246,9 +300,13 @@ export default function ContactPage() { {/* Get Directions Button */}
- +
@@ -260,16 +318,16 @@ export default function ContactPage() {

- Ready to find an agent? + {cta.title}

- Discover trusted agents and start your property journey with confidence. + {cta.description}

- Start Your Search + {cta.buttonText}