(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[80],{6632:(e,a,l)=>{Promise.resolve().then(l.bind(l,8544))},8544:(e,a,l)=>{"use strict";l.r(a),l.d(a,{default:()=>n});var t=l(5155),s=l(2115),r=l(6153);let n=()=>{let[e,a]=(0,s.useState)({name:"",email:"",message:"",rating:null}),[l,n]=(0,s.useState)({}),[i,c]=(0,s.useState)(!1),[o,u]=(0,s.useState)(""),d=()=>{let a={};return e.name.trim()||(a.name="Name is required."),e.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.email)||(a.email="Invalid email format."):a.email="Email is required.",e.rating||(a.rating="Please select your satisfaction level."),n(a),0===Object.keys(a).length},m=async l=>{if(l.preventDefault(),!d())return;let t=await fetch("/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)u("Feedback submitted successfully!"),c(!0),a({name:"",email:"",message:"",rating:null});else{let{error:e}=await t.json();u(e||"Something went wrong, please try again later")}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{}),(0,t.jsx)("div",{className:"pt-36 flex justify-center items-center min-h-screen bg-gradient-to-br from-blue-50 to-blue-100 p-4",children:(0,t.jsxs)("div",{className:"w-full max-w-lg bg-white p-8 rounded-xl shadow-lg transition-all",children:[i&&(0,t.jsx)("div",{className:"mb-4 p-3 text-green-700 bg-green-100 rounded-lg text-center font-semibold",children:"\uD83C\uDF89 Thank you for your feedback!"}),o&&(0,t.jsx)("div",{className:"mb-4 p-3 ".concat(o.includes("success")?"text-green-700 bg-green-100":"text-red-700 bg-red-100"," rounded-lg text-center font-semibold"),children:o}),(0,t.jsx)("h1",{className:"text-3xl font-bold text-center text-protoblue-600 mb-4",children:"We Value Your Feedback"}),(0,t.jsx)("p",{className:"text-gray-600 text-center mb-6",children:"Help us improve by sharing your thoughts. \uD83D\uDCA1"}),(0,t.jsxs)("form",{onSubmit:m,className:"space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-gray-700 font-medium",children:"Name"}),(0,t.jsx)("input",{type:"text",className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 transition-all",placeholder:"Enter your name",value:e.name,onChange:l=>a({...e,name:l.target.value})}),l.name&&(0,t.jsx)("p",{className:"text-red-500 text-sm mt-1",children:l.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-gray-700 font-medium",children:"Email"}),(0,t.jsx)("input",{type:"email",className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 transition-all",placeholder:"Enter your email",value:e.email,onChange:l=>a({...e,email:l.target.value})}),l.email&&(0,t.jsx)("p",{className:"text-red-500 text-sm mt-1",children:l.email})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-gray-700 font-medium",children:"Message (Optional)"}),(0,t.jsx)("textarea",{className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 resize-none transition-all",rows:"4",placeholder:"Share your experience...",value:e.message,onChange:l=>a({...e,message:l.target.value})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-gray-700 font-medium mb-2",children:"How was your experience?"}),(0,t.jsx)("div",{className:"flex justify-between",children:[{value:1,label:"\uD83D\uDE1E Very Dissatisfied"},{value:2,label:"\uD83D\uDE10 Dissatisfied"},{value:3,label:"\uD83D\uDE36 Neutral"},{value:4,label:"\uD83D\uDE0A Satisfied"},{value:5,label:"\uD83D\uDE0D Very Satisfied"}].map(l=>(0,t.jsxs)("label",{className:"flex flex-col items-center cursor-pointer",children:[(0,t.jsx)("input",{type:"radio",name:"rating",value:l.value,checked:e.rating===l.value,onChange:()=>a({...e,rating:l.value}),className:"hidden"}),(0,t.jsx)("span",{className:"text-2xl p-2 rounded-full transition-all ".concat(e.rating===l.value?"bg-blue-500 text-white":"bg-gray-200"),children:l.label.split(" ")[0]}),(0,t.jsx)("span",{className:"text-xs mt-1 text-gray-600",children:l.label.split(" ").slice(1).join(" ")})]},l.value))}),l.rating&&(0,t.jsx)("p",{className:"text-red-500 text-sm mt-1",children:l.rating})]}),(0,t.jsx)("button",{type:"submit",className:"w-full bg-protopink text-white font-semibold py-3 rounded-lg hover:bg-protoblue-700 transition-all",children:"Submit Feedback"})]})]})})]})}}},e=>{var a=a=>e(e.s=a);e.O(0,[766,863,153,441,684,358],()=>a(6632)),_N_E=e.O()}]);