'use client'; import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import Navigation from '@/components/Navigation'; import Footer from '@/components/Footer'; export default function FeedbackPage() { const [formData, setFormData] = useState({ name: '', email: '', message: '', }); const [status, setStatus] = useState<'idle' | 'submitting' | 'success' | 'error'>('idle'); const [errorMessage, setErrorMessage] = useState(''); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setStatus('submitting'); setErrorMessage(''); const form = e.currentTarget; const formDataObj = new FormData(form); try { const response = await fetch(form.action, { method: form.method, body: formDataObj, headers: { 'Accept': 'application/json', }, }); if (response.ok) { setStatus('success'); setFormData({ name: '', email: '', message: '', }); form.reset(); // Reset success message after 6 seconds setTimeout(() => { setStatus('idle'); }, 6000); } else { const responseData = await response.json(); if (responseData.errors) { setErrorMessage(responseData.errors.map((error: { message: string }) => error.message).join(', ')); } else { setErrorMessage('Oops! There was a problem submitting your form. Please try again.'); } setStatus('error'); } } catch (error) { console.error('Form submission error:', error); setErrorMessage('Oops! There was a problem submitting your form. Please check your connection and try again.'); setStatus('error'); } }; const handleChange = (e: React.ChangeEvent) => { setFormData({ ...formData, [e.target.name]: e.target.value, }); }; return (

Share Your Feedback

I value your thoughts and suggestions. Your feedback helps me improve my work and services.

{status === 'success' ? ( {/* Animated background circles */} {/* Success icon with multiple animations */} {/* Confetti effect using dots */} {[...Array(12)].map((_, i) => ( ))} Thanks for your submission! Your feedback helps me improve my services. {/* Subtle pulse animation */} ) : (

Optional - but helpful if we need to follow up