1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3490],{79701:function(e,s,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/review/[reviewId]",function(){return i(51598)}])},51598:function(e,s,i){"use strict";i.r(s),i.d(s,{__N_SSP:function(){return A},default:function(){return k}});var t=i(52676),r=i(33561),n=i(69947),u=i(69834),l=i(71030),a=i(9059),d=i(76517),o=i(49810),c=i(75271),m=i(56220),v=i(18060),x=i(99508),f=i(78051),p=i(29350),g=i(77471),w=i(3833),h=i(87517),j=i(88463),y=i(52043),I=i.n(y),N=i(94799),Z=i(22903),_=i(27062);let{Title:E}=m.default;var b=e=>{let{review:s,onSubmit:i,saving:r}=e,[n]=v.Z.useForm(),[u,l]=(0,c.useState)([]),[a,d]=(0,c.useState)([]);return(0,c.useEffect)(()=>{if(!s)return;let e=s.isExistingCustomer&&!!s.user,i=s.user?"".concat("".concat(s.user.firstName||""," ").concat(s.user.lastName||"").trim()||"Unnamed").concat(s.user.email?" (".concat(s.user.email,")"):""):"";n.setFieldsValue({isExistingCustomer:e,customer:s.user?{label:i,value:s.user.refId,key:s.user.refId}:null,name:e?"":s.rawName||s.name,product:s.product?{label:s.product.name,value:s.product.refId,key:s.product.refId}:null,rating:s.rating,description:s.description,status:s.status,reviewedAt:I()(s.reviewedAt)}),l(s.images.map(e=>({uid:e.refId,name:e.name,status:"done",url:(0,Z.I)(e.key),type:e.mimeType}))),d(s.video?[{uid:s.video.refId,name:s.video.name,status:"done",url:(0,Z.I)(s.video.key),type:s.video.mimeType}]:[])},[s,n]),(0,t.jsxs)("div",{className:"px-4 mx-auto max-w-7xl sm:px-6 lg:px-8",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 mb-6 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsx)(E,{level:2,className:"mb-2",children:"Edit Review"}),(0,t.jsx)(x.Z,{children:(0,t.jsx)(f.ZP,{type:"primary",icon:(0,t.jsx)(N.Z,{size:16}),loading:r,onClick:()=>n.submit(),children:"Save Review"})})]}),(0,t.jsx)(v.Z,{form:n,layout:"vertical",onFinish:e=>{var s,t,r,n;i({isExistingCustomer:e.isExistingCustomer,userId:e.isExistingCustomer&&(null===(s=e.customer)||void 0===s?void 0:s.value)||null,name:e.isExistingCustomer?null:(null===(t=e.name)||void 0===t?void 0:t.trim())||null,productId:(null===(r=e.product)||void 0===r?void 0:r.value)||"",rating:e.rating||0,description:e.description||"",images:u.map(e=>e.response?e.response.uid:e.uid).filter(Boolean),video:a[0]?(null===(n=a[0].response)||void 0===n?void 0:n.uid)||a[0].uid:null,status:e.status,reviewedAt:e.reviewedAt.toISOString()})},autoComplete:"off",children:(0,t.jsxs)(p.Z,{gutter:[24,24],children:[(0,t.jsx)(g.Z,{xs:24,lg:16,children:(0,t.jsx)(w.Z,{title:"Review Details",className:"!mb-6",children:(0,t.jsx)(_.Z,{form:n,imageList:u,setImageList:l,videoList:a,setVideoList:d})})}),(0,t.jsx)(g.Z,{xs:24,lg:8,children:(0,t.jsxs)(w.Z,{title:"Status & Schedule",className:"!mb-6",children:[(0,t.jsx)(v.Z.Item,{name:"status",label:"Status",rules:[{required:!0}],children:(0,t.jsxs)(h.ZP.Group,{children:[(0,t.jsx)(h.ZP,{value:"ACTIVE",children:"Active"}),(0,t.jsx)(h.ZP,{value:"INACTIVE",children:"Inactive"})]})}),(0,t.jsx)(v.Z.Item,{name:"reviewedAt",label:"Reviewed At",rules:[{required:!0}],children:(0,t.jsx)(j.default,{className:"w-full",showTime:!0})})]})})]})})]})},S=i(15831),C=i(83214),A=!0,k=e=>{let{user:s}=e,{reviewId:i}=(0,r.useRouter)().query,c=(0,n.NL)(),m=(0,u.a)({queryKey:["review",i],queryFn:()=>(0,S.Tn)(i),enabled:!!i,select:e=>e.data}),v=(0,l.D)({mutationFn:e=>(0,S.g8)(i,e),onSuccess:()=>{c.invalidateQueries({queryKey:["review"]})}});return(0,t.jsx)(o.Z,{user:s,card:!1,activeMenu:["review"],children:m.isPending?(0,t.jsx)("div",{className:"flex justify-center py-20",children:(0,t.jsx)(a.Z,{size:"large"})}):(0,t.jsx)(b,{review:m.data,onSubmit:e=>{d.Am.promise(v.mutateAsync(e),{pending:"Saving review...",success:"Review saved successfully",error:{render(e){let{data:s}=e;return(0,C._g)(s)}}})},saving:v.isPending})})}}},function(e){e.O(0,[5989,4237,7610,8174,9834,8051,9513,4540,928,4298,4190,6631,6220,9575,7444,150,1887,5934,8060,9059,7645,8463,3532,7476,7206,1123,8269,2888,9774,179],function(){return e(e.s=79701)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.