"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[86958],{69875:(e,s,n)=>{n.d(s,{A:()=>a});n(65043);const a=n.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,s,n)=>{n.d(s,{A:()=>u});n(65043);var a=n(67784),t=n(4701),l=n(17392),o=n(10155),i=n(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)(a.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,n)=>{n.r(s),n.d(s,{default:()=>g});var a=n(65043),t=n(11906),l=n(68903),o=n(38624),i=n(96446),r=n(24659),d=(n(69875),n(63516)),u=n(14556),c=n(73033),m=n(73216),h=n(66675),v=n(11852),x=n(96801),j=(n(17115),n(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)(),n=(null===s||void 0===s?void 0:s.state)._original;console.log("milestoneTypeData",n);const[c,x]=(0,a.useState)(!1),p=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],A=a.useRef(null),[g,b]=(0,a.useState)(I),D=(0,u.wA)(),f=(0,m.Zp)();(0,a.useEffect)((()=>{n&&b({...g,reasonName:null===n||void 0===n?void 0:n.reason_name,statusID:{id:null===n||void 0===n?void 0:n.status,name:null===n||void 0===n?void 0:n.status}})}),[n]),console.log("milestoneTypeData",n);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:()=>{f(-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 a,t;const l={reasonId:null===n||void 0===n?void 0:n.id,reasonName:e.reasonName,reasonStatus:null!==(a=e.statusID)&&void 0!==a&&a.id?null===(t=e.statusID)||void 0===t?void 0:t.id:""};console.log("finalPayload",l),s.setSubmitting(!0),await D((0,v.LQ7)(l)),S(),f("/bd-masters/ProjectDropReason")},children:e=>{let{errors:s,handleSubmit:n,handleChange:a,handleBlur:u,setFieldValue:c,isSubmitting:m,isValid:h,touched:v,values:x}=e;return(0,j.jsx)(d.lV,{onSubmit:n,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"})})})]})})}})})]})}}}]);
//# sourceMappingURL=86958.fe065da8.chunk.js.map