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