"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[25020],{24659:(e,t,s)=>{s.d(t,{A:()=>u});s(65043);var n=s(67784),l=s(4701),a=s(17392),i=s(10155),o=s(70579);const r=(0,l.A)({}),d=e=>{let{onClick:t}=e;return(0,o.jsx)(a.A,{onClick:t,children:(0,o.jsx)(i.A,{})})},u=e=>{const t=r();return(0,o.jsx)(n.A,{InputProps:{...t,endAdornment:(0,o.jsxs)(o.Fragment,{children:[" ",e.iscross&&(0,o.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},25020:(e,t,s)=>{s.r(t),s.d(t,{default:()=>D});var n=s(65043),l=s(11906),a=s(68903),i=s(38624),o=s(96446),r=s(24659),d=s(63516),u=s(14556),c=s(73033),m=s(73216),h=s(66675),v=s(80884),x=s(96801),A=(s(17115),s(70579));const j=(0,x.Gq)("enuseloc"),p=j&&Object.keys(j).length>0?j.user_id:null;console.log("LoginuserId",p);const I={statusID:""},f=c.Ik().shape({statusID:c.Ik().nullable().required("Select Status")});const D=function(e){const t=(0,m.zy)(),s=null===t||void 0===t?void 0:t.state,c=null===s||void 0===s?void 0:s._original;console.log("milestoneTypeData",c);const[x,j]=(0,n.useState)(!1),p=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],D=n.useRef(null),[b,g]=(0,n.useState)(I),S=(0,u.wA)(),k=(0,m.Zp)();(0,n.useEffect)((()=>{c&&g({...b,statusID:{id:null===c||void 0===c?void 0:c.status,name:null===c||void 0===c?void 0:c.status}})}),[c]),console.log("milestoneTypeData",c);const y=()=>{const{holidayName:e,...t}=I;g({...b,...t})};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"common-header-label-bold",children:[(0,A.jsx)(l.A,{onClick:()=>{k(-1)},children:(0,A.jsx)(h.A,{})}),"Update Form 16 Status "]}),(0,A.jsx)("div",{className:"component-list",children:(0,A.jsx)(d.l1,{enableReinitialize:!0,innerRef:D,validationSchema:f,initialValues:b,onSubmit:async(e,t)=>{var s,n;const l={form16ID:null===c||void 0===c?void 0:c.id,status:null!==(s=e.statusID)&&void 0!==s&&s.id?null===(n=e.statusID)||void 0===n?void 0:n.id:""};console.log("finalPayload",l),t.setSubmitting(!0),await S((0,v._Gc)(l)),y(),k("/hr/form-16")},children:e=>{let{errors:t,handleSubmit:s,handleChange:n,handleBlur:u,setFieldValue:c,isSubmitting:m,isValid:h,touched:v,values:x}=e;return(0,A.jsx)(d.lV,{onSubmit:s,children:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Ay,{container:!0,className:"component-form",children:(0,A.jsx)(a.Ay,{container:!0,children:(0,A.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(i.A,{name:"statusID",value:x.statusID,fullWidth:!0,options:p||[],onBlur:u,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,t)=>{c("statusID",t),g({...b,statusID:t})},renderInput:e=>(0,A.jsx)(r.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:t.statusID&&t.statusID,error:t.statusID&&Boolean(t.statusID)})})})})}),(0,A.jsx)(a.Ay,{className:"d-flex justify-content-center",p:2,children:(0,A.jsx)(o.A,{children:(0,A.jsx)(l.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}},10155:(e,t,s)=>{var n=s(24994);t.A=void 0;var l=n(s(40039)),a=s(70579);t.A=(0,l.default)((0,a.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=25020.9720e32b.chunk.js.map