"use client"; import { useState } from 'react'; import axios from 'axios'; export default function StainingQuote() { const [formData, setFormData] = useState({ name: '', email: '', phone: '', projectType: 'fence', location: '', size: '', message: '' }); const [status, setStatus] = useState<"idle" | "submitting" | "success" | "error">("idle"); const handleChange = (e: React.ChangeEvent) => { setFormData({ ...formData, [e.target.name]: e.target.value }); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setStatus("submitting"); const emailData = { name: formData.name, email: formData.email, phone: formData.phone, service: formData.projectType || "Wood Staining", message: ` Service: ${formData.projectType}
Location: ${formData.location}
Approx Size: ${formData.size}

Additional Notes: ${formData.message || "N/A"} `, to: "info@vgfenceproducts.com", senderName: "VG Fence Staining Page", }; try { await axios.post("https://mailserver.metatronnest.com/send", emailData, { headers: { "Content-Type": "application/json" }, }); setStatus("success"); setFormData({ name: '', email: '', phone: '', projectType: 'fence', location: '', size: '', message: '' }); } catch (error) { console.error("❌ Error sending staining quote request:", error); setStatus("error"); } }; return (

TELL US WHAT YOU NEED
AND WHERE IT'S GOING.

Get a wood staining quote and timeline within 2 business hours.

{status === "success" ? (

Request Sent!

Thank you. We'll be in touch within 2 business hours.

) : (
REQUEST A STAINING QUOTE
Response within 2 business hours
{status === "error" && (

⚠️ Failed to send request. Please try again or email us directly.

)}
)}
); }