home contact section correction updated
This commit is contained in:
parent
08c3ebb39d
commit
43acd616a5
@ -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: `
|
||||
<strong>Reservation Details:</strong><br/>
|
||||
Name: ${formData.name}<br/>
|
||||
Email: ${formData.email}<br/>
|
||||
Phone: ${formData.phone}<br/>
|
||||
Date: ${formData.date}<br/><br/>
|
||||
<strong>Message:</strong><br/>
|
||||
@ -92,6 +96,7 @@ export default function BookTable() {
|
||||
|
||||
setFormData({
|
||||
name: "",
|
||||
email: "",
|
||||
phone: "",
|
||||
date: "",
|
||||
message: "",
|
||||
@ -166,6 +171,23 @@ export default function BookTable() {
|
||||
{formErrors.name && <small className={styles.errorText}>{formErrors.name}</small>}
|
||||
</div>
|
||||
|
||||
{/* Email Input with Placeholder */}
|
||||
<div className={styles.inputGroup}>
|
||||
<label htmlFor="email" className={styles.label}>Email *</label>
|
||||
<input
|
||||
type="email"
|
||||
id="email"
|
||||
name="email"
|
||||
required
|
||||
className={styles.input}
|
||||
placeholder="Email"
|
||||
value={formData.email}
|
||||
onChange={handleChange}
|
||||
suppressHydrationWarning
|
||||
/>
|
||||
{formErrors.email && <small className={styles.errorText}>{formErrors.email}</small>}
|
||||
</div>
|
||||
|
||||
{/* Phone Input with Placeholder */}
|
||||
<div className={styles.inputGroup}>
|
||||
<label htmlFor="phone" className={styles.label}>Phone *</label>
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user