(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[667],{1787:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>d});var l=a(5155),t=a(2115),i=a(6766),r=a(3464),c=a(6874),n=a.n(c);let d=()=>{let[e,s]=(0,t.useState)({email:"",subject:"",message:"",department:"contact"}),[a,c]=(0,t.useState)({}),[d,m]=(0,t.useState)(!1),[o,x]=(0,t.useState)(""),h=()=>{let s={};return e.email?/\S+@\S+\.\S+/.test(e.email)||(s.email="Please enter a valid email address"):s.email="Email is required",e.subject||(s.subject="Subject is required"),e.message||(s.message="Message is required"),c(s),0===Object.keys(s).length},p=a=>{s({...e,[a.target.name]:a.target.value})},u=async a=>{if(a.preventDefault(),h()){m(!0),x("");try{let a=await r.A.post("/api/mailer",e);console.log("Response:",a.data),200===a.status?(x("Email sent successfully!"),s({email:"",subject:"",message:"",department:"contact"})):x(a.data.error||"Failed to send email.")}catch(e){console.error("Error sending email:",e),x("An error occurred. Please try again later.")}finally{m(!1)}}};return(0,l.jsxs)("footer",{className:"bg-protoblue","aria-labelledby":"footer-heading",children:[(0,l.jsx)("h2",{id:"footer-heading",className:"sr-only",children:"Footer"}),(0,l.jsxs)("div",{className:"mx-auto container px-6 pb-8 pt-16 sm:pt-24 lg:px-8 lg:pt-32",children:[(0,l.jsxs)("div",{className:"xl:grid xl:grid-cols-4 xl:gap-8",children:[(0,l.jsxs)("div",{className:"space-y-8 xl:col-span-2",children:[(0,l.jsx)(i.default,{src:"/images/proto_logo.png",alt:"Proto Energy",width:150,height:50}),(0,l.jsx)("p",{className:"text-sm leading-6 text-gray-300 max-w-sm",children:"We care deeply about what we do and the impact we have with our partners and communities."}),(0,l.jsx)("div",{className:"flex space-x-6"})]}),(0,l.jsxs)("div",{className:"mt-16 grid grid-cols-1 sm:grid-cols-2 gap-8 xl:col-span-2 xl:mt-0",children:[(0,l.jsxs)("div",{className:"col-span-1",children:[(0,l.jsx)("h3",{className:"text-base font-semibold leading-6 text-white",children:"Head Office"}),(0,l.jsxs)("ul",{role:"list",className:"mt-6 space-y-2 text-base text-white",children:[(0,l.jsxs)("li",{children:["5",(0,l.jsx)("sup",{children:"th"})," Floor, The RiverFront,"]}),(0,l.jsx)("li",{children:"Prof. David Wasawo Drive, Off Riverside"}),(0,l.jsx)("li",{children:"P.O. BOX 50384 - 00100"}),(0,l.jsx)("li",{children:"Nairobi, Kenya"}),(0,l.jsx)("li",{children:(0,l.jsx)("a",{href:"tel:+254709373000",children:"+254 709 373 000"})})]})]}),(0,l.jsx)("div",{className:"col-span-1",children:(0,l.jsxs)("div",{className:"bg-white",children:[(0,l.jsx)("div",{className:"bg-protopink px-4 py-1",children:(0,l.jsx)("h2",{className:"text-lg text-white font-semibold",children:"Contact Us"})}),(0,l.jsxs)("form",{onSubmit:u,className:"grid grid-cols-6 gap-2 p-4",children:[(0,l.jsxs)("div",{className:"col-span-full",children:[(0,l.jsx)("input",{type:"email",name:"email",className:"user_dialog_input",placeholder:"Email",value:e.email,onChange:p}),a.email&&(0,l.jsx)("p",{className:"text-red-500",children:a.email})]}),(0,l.jsxs)("div",{className:"col-span-full",children:[(0,l.jsx)("input",{type:"text",name:"subject",className:"user_dialog_input",placeholder:"Subject",value:e.subject,onChange:p}),a.subject&&(0,l.jsx)("p",{className:"text-red-500",children:a.subject})]}),(0,l.jsxs)("div",{className:"col-span-full",children:[(0,l.jsx)("textarea",{name:"message",className:"user_dialog_input",placeholder:"Your message",rows:"4",value:e.message,onChange:p}),a.message&&(0,l.jsx)("p",{className:"text-red-500",children:a.message})]}),(0,l.jsx)("div",{className:"col-span-full",children:(0,l.jsx)("button",{type:"submit",className:"w-full btn btn-primary",disabled:d,children:d?"Sending...":"Send Mail"})}),o&&(0,l.jsx)("p",{className:"col-span-full text-center mt-2 text-red-500",children:o})]})]})})]})]}),(0,l.jsx)("div",{className:"mt-16 border-t border-white/10 pt-8 sm:mt-20 lg:mt-24",children:(0,l.jsxs)("div",{className:"flex flex-col lg:flex-row lg:justify-between lg:items-center",children:[(0,l.jsxs)("ul",{className:"flex items-center flex-wrap space-x-4 lg:divide-x lg:divide-white",children:[(0,l.jsx)("li",{className:"px-2",children:(0,l.jsx)(n(),{href:"/privacy-statement",children:(0,l.jsx)("span",{className:"text-base text-white",children:"Privacy Statement"})})}),(0,l.jsx)("li",{className:"px-2",children:(0,l.jsx)(n(),{href:"/terms-and-conditions",children:(0,l.jsx)("span",{className:"text-base text-white",children:"Terms & Conditions"})})})]}),(0,l.jsxs)("p",{className:"text-xs text-center leading-5 text-gray-100 mt-4 lg:mt-0",children:["\xa9 ",new Date().getFullYear()," Powered by Proto Energy Limited"]})]})})]})]})}},6011:(e,s,a)=>{Promise.resolve().then(a.t.bind(a,3063,23)),Promise.resolve().then(a.bind(a,1787)),Promise.resolve().then(a.bind(a,6153))}},e=>{var s=s=>e(e.s=s);e.O(0,[261,464,153,441,684,358],()=>s(6011)),_N_E=e.O()}]);