"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[57761],{69875:(e,n,t)=>{t.d(n,{A:()=>s});t(65043);const s=t.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,n,t)=>{t.d(n,{A:()=>u});t(65043);var s=t(67784),a=t(4701),l=t(17392),o=t(10155),i=t(70579);const r=(0,a.A)({}),d=e=>{let{onClick:n}=e;return(0,i.jsx)(l.A,{onClick:n,children:(0,i.jsx)(o.A,{})})},u=e=>{const n=r();return(0,i.jsx)(s.A,{InputProps:{...n,endAdornment:(0,i.jsxs)(i.Fragment,{children:[" ",e.iscross&&(0,i.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},57761:(e,n,t)=>{t.r(n),t.d(n,{default:()=>N});var s=t(65043),a=t(11906),l=t(68903),o=t(38624),i=t(96446),r=t(24659),d=(t(69875),t(63516)),u=t(14556),c=t(73033),m=t(73216),h=t(66675),v=t(11852),j=t(96801),x=(t(17115),t(70579));const p=(0,j.Gq)("enuseloc"),A=p&&Object.keys(p).length>0?p.user_id:null;console.log("LoginuserId",A);const z={zoneName:"",statusID:""},I=c.Ik().shape({zoneName:c.Yj("Enter Zone Name ").required("Zone Name is required"),statusID:c.Ik().nullable().required("Select Status")});const N=function(e){const n=(0,m.zy)(),t=(null===n||void 0===n?void 0:n.state)._original;console.log("projectzoneData",t);const[c,j]=(0,s.useState)(!1),p=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],A=s.useRef(null),[N,g]=(0,s.useState)(z),b=(0,u.wA)(),f=(0,m.Zp)();(0,s.useEffect)((()=>{t&&g({...N,zoneName:null===t||void 0===t?void 0:t.zone_name,statusID:{id:null===t||void 0===t?void 0:t.status,name:null===t||void 0===t?void 0:t.status}})}),[t]),console.log("projectzoneData",t);const D=()=>{const{zoneName:e,...n}=z;g({...N,...n})};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"common-header-label-bold",children:[(0,x.jsx)(a.A,{onClick:()=>{f(-1)},children:(0,x.jsx)(h.A,{})}),"Update Project Zone"]}),(0,x.jsx)("div",{className:"component-list",children:(0,x.jsx)(d.l1,{enableReinitialize:!0,innerRef:A,validationSchema:I,initialValues:N,onSubmit:async(e,n)=>{var s,a;const l={projectZoneID:null===t||void 0===t?void 0:t.id,zoneName:e.zoneName,status:null!==(s=e.statusID)&&void 0!==s&&s.id?null===(a=e.statusID)||void 0===a?void 0:a.id:""};console.log("finalPayload",l),n.setSubmitting(!0),await b((0,v.UEN)(l)),D(),f("/bd-masters/projectZone")},children:e=>{let{errors:n,handleSubmit:t,handleChange:s,handleBlur:u,setFieldValue:c,isSubmitting:m,isValid:h,touched:v,values:j}=e;return(0,x.jsx)(d.lV,{onSubmit:t,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,x.jsxs)(l.Ay,{container:!0,children:[(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(r.A,{fullWidth:!0,label:"Zone Name*",name:"zoneName",onBlur:u,value:j.zoneName,onChange:(e,n)=>{c("zoneName",n),g({...N,zoneName:e.target.value})},variant:"outlined",size:"small",helperText:v.zoneName&&n.zoneName,error:v.zoneName&&Boolean(n.zoneName)})}),(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(o.A,{name:"statusID",value:j.statusID,fullWidth:!0,options:p||[],onBlur:u,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,n)=>{c("statusID",n),g({...N,statusID:n})},renderInput:e=>(0,x.jsx)(r.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:n.statusID&&n.statusID,error:n.statusID&&Boolean(n.statusID)})})})]})}),(0,x.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,x.jsx)(i.A,{children:(0,x.jsx)(a.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}},10155:(e,n,t)=>{var s=t(24994);n.A=void 0;var a=s(t(40039)),l=t(70579);n.A=(0,a.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")}}]);
//# sourceMappingURL=57761.e59dcfca.chunk.js.map