"use client"; import { useState } from "react"; import contactData from "./contact.json"; export default function ContactPage() { const [formData, setFormData] = useState({ fullName: "", email: "", phone: "", service: "", message: "", }); const handleInputChange = ( e: React.ChangeEvent< HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement >, ) => { const { name, value } = e.target; setFormData((prev) => ({ ...prev, [name]: value, })); }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); console.log("Form submitted:", formData); // Handle form submission here alert( "Cảm ơn bạn đã liên hệ! Chúng tôi sẽ phản hồi trong thời gian sớm nhất.", ); }; return (
{/* Header */}

{contactData.title}

{contactData.subtitle}

{/* Contact Information */}

Thông Tin Liên Hệ

{/* Contact Details */}
{Object.entries(contactData.contactInfo).map(([key, info]) => (
{info.icon}

{info.label}

{info.value}

))}
{/* Offices */}

Văn Phòng

{contactData.offices.map((office, index) => (

{office.name}

📍 {office.address}

📞 {office.phone}

✉️ {office.email}

))}
{/* Contact Form */}

Gửi Tin Nhắn

{contactData.formFields.map((field) => (
{field.type === "textarea" ? (