update doormile approach

This commit is contained in:
2026-06-16 13:06:28 +05:30
parent 1286045a21
commit 09082a12a5
8 changed files with 81 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
import React, { useState, useEffect } from "react";
import Link from "next/link";
import Image from "next/image";
import { sendContactEmail } from "@/actions/sendEmail";
import { submitContactForm } from "@/lib/contactForm";
import { ScrollReveal } from "@/animations/Reveal";
export default function Footer() {
@@ -55,18 +55,13 @@ export default function Footer() {
setFormStatus("submitting");
try {
const res = await sendContactEmail({
fullName: formData.fullName,
email: formData.email,
subject: formData.subject,
message: formData.message,
});
const res = await submitContactForm(formData);
if (res.success) {
setFormStatus("success");
setFormData({ fullName: "", email: "", subject: "", message: "" });
} else {
console.error("Failed to send contact email:", res.error);
console.error("Failed to submit contact form");
setFormStatus("error");
}
} catch (err) {