(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[372],{57926:function(e,s,l){Promise.resolve().then(l.bind(l,91039))},91039:function(e,s,l){"use strict";var a=l(57437),t=l(2265),i=l(96621),n=l(33145),d=l(29116);let r=e=>{let{icon:s,label:l}=e;return(0,a.jsxs)("div",{className:"bg-white p-4 rounded-lg shadow flex items-center gap-4",children:[(0,a.jsx)(n.default,{src:s,alt:"",width:18,height:18}),(0,a.jsx)("span",{className:"font-medium",children:l||"Not provided"})]})};s.default=e=>{let{visitorId:s}=e,[l,c]=(0,t.useState)(null);return((0,t.useEffect)(()=>{(async()=>{try{let e=await (0,d.tS)(s);c(e)}catch(e){console.error("Error fetching visitor data:",e)}})()},[s]),l)?(0,a.jsx)("div",{className:"flex-1 p-4 flex flex-col gap-4 xl:flex-row w-full",children:(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)("div",{className:"flex flex-col lg:flex-row gap-4 w-full",children:(0,a.jsxs)("div",{className:"bg-slate-400 py-3 px-4 rounded-md flex gap-4 w-full h-48 mt-2",children:[(0,a.jsx)("div",{className:"w-1/3",children:(0,a.jsx)(n.default,{src:"/avatar.png",alt:"",width:100,height:100,className:"w-36 h-36 rounded-full object-cover mt-3"})}),(0,a.jsxs)("div",{className:"w-2/3 flex flex-col justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:l.name}),(0,a.jsx)(i.Z,{table:"Visitors",type:"update"})]}),(0,a.jsx)("div",{className:"flex items-center justify-between gap-2 flex-wrap text-xs font-medium",children:(0,a.jsxs)("div",{className:"w-full md:w-1/3 flex items-center gap-2",children:[(0,a.jsx)(n.default,{src:"/role.png",alt:"",width:18,height:18}),(0,a.jsx)("span",{className:"text-lg font-medium text-gray-700 mt-0",children:l.role||"Visitor"})]})})]})]})}),(0,a.jsxs)("div",{className:"mt-4 bg-slate-300 py-6 px-4 rounded-md w-full",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Personal Information"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,a.jsx)(r,{icon:"/gender.png",label:l.gender}),(0,a.jsx)(r,{icon:"/birthday.png",label:l.dob}),(0,a.jsx)(r,{icon:"/mobile.png",label:l.phoneNumber}),(0,a.jsx)(r,{icon:"/email.png",label:l.email}),(0,a.jsx)(r,{icon:"/id-card.png",label:l.idNumber}),(0,a.jsx)(r,{icon:"/resident.png",label:l.address})]})]}),(0,a.jsxs)("div",{className:"mt-4 bg-slate-300 py-6 px-4 rounded-md w-full",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Visitor Information"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,a.jsx)(r,{icon:"/date_joined.png",label:l.dateJoined}),(0,a.jsx)(r,{icon:"/status.png",label:l.membershipStatus}),(0,a.jsx)(r,{icon:"/events.png",label:l.baptismStatus||"Not baptized"})]})]}),(0,a.jsxs)("div",{className:"bg-white p-4 rounded-lg shadow flex flex-col gap-2 col-span-full mt-4",children:[(0,a.jsx)("h3",{className:"text-md font-semibold",children:"Notes"}),(0,a.jsx)("textarea",{name:"notes",className:"w-full p-2 border rounded-md resize-none focus:outline-none focus:ring-2 focus:ring-blue-400",rows:4,placeholder:"Leave a note about this visitor...",defaultValue:l.notes||""})]})]})}):(0,a.jsx)("div",{children:"Loading..."})}}},function(e){e.O(0,[145,505,621,971,117,744],function(){return e(e.s=57926)}),_N_E=e.O()}]);