From 43acd616a5be69e9d233d946c1b2b2feb3bced02 Mon Sep 17 00:00:00 2001 From: akash Date: Thu, 22 Jan 2026 00:46:43 +0530 Subject: [PATCH] home contact section correction updated --- src/components/BookTable/BookTable.tsx | 24 +++++++++++++++++++- src/components/Testimonials/Testimonials.tsx | 4 +++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/components/BookTable/BookTable.tsx b/src/components/BookTable/BookTable.tsx index 2b121a8..81027a2 100644 --- a/src/components/BookTable/BookTable.tsx +++ b/src/components/BookTable/BookTable.tsx @@ -8,6 +8,7 @@ import styles from './BookTable.module.css' interface FormErrors { name?: string; + email?: string; phone?: string; date?: string; captcha?: string; @@ -24,6 +25,7 @@ export default function BookTable() { const [formData, setFormData] = useState({ name: "", + email: "", phone: "", date: "", message: "", @@ -52,6 +54,7 @@ export default function BookTable() { const errors: FormErrors = {}; if (!formData.name.trim()) errors.name = "Name is required."; + if (!formData.email.trim()) errors.email = "Email is required."; if (!formData.phone.trim()) errors.phone = "Phone is required."; if (!formData.date.trim()) errors.date = "Date is required."; if (!captchaToken) errors.captcha = "Please verify the CAPTCHA."; @@ -62,11 +65,12 @@ export default function BookTable() { const emailData = { name: formData.name, phone: formData.phone, - email: email, + email: formData.email, subject: `Table Reservation - ${formData.name} on ${formData.date}`, message: ` Reservation Details:
Name: ${formData.name}
+ Email: ${formData.email}
Phone: ${formData.phone}
Date: ${formData.date}

Message:
@@ -92,6 +96,7 @@ export default function BookTable() { setFormData({ name: "", + email: "", phone: "", date: "", message: "", @@ -166,6 +171,23 @@ export default function BookTable() { {formErrors.name && {formErrors.name}} + {/* Email Input with Placeholder */} +
+ + + {formErrors.email && {formErrors.email}} +
+ {/* Phone Input with Placeholder */}
diff --git a/src/components/Testimonials/Testimonials.tsx b/src/components/Testimonials/Testimonials.tsx index 2be3afd..d79ab63 100644 --- a/src/components/Testimonials/Testimonials.tsx +++ b/src/components/Testimonials/Testimonials.tsx @@ -95,7 +95,9 @@ export default function Testimonials() { const errorData = await res.json(); details = errorData.details || errorData.error || "No details"; } catch (e) { } - throw new Error(`HTTP error! status: ${res.status} - ${details}`); + console.error(`HTTP error! status: ${res.status} - ${details}`); + setLoading(false); + return; } const text = await res.text(); let dataAt;