"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[92979],{24659:(e,t,a)=>{a.d(t,{A:()=>d});a(65043);var s=a(67784),r=a(4701),n=a(17392),l=a(10155),o=a(70579);const i=(0,r.A)({}),c=e=>{let{onClick:t}=e;return(0,o.jsx)(n.A,{onClick:t,children:(0,o.jsx)(l.A,{})})},d=e=>{const t=i();return(0,o.jsx)(s.A,{InputProps:{...t,endAdornment:(0,o.jsxs)(o.Fragment,{children:[" ",e.iscross&&(0,o.jsx)(c,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},92979:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var s=a(65043),r=a(11906),n=a(68903),l=a(38624),o=a(96446),i=a(24659),c=a(63516),d=a(14556),u=a(73033),m=a(73216),j=a(66675),h=a(96801),v=a(11852),g=a(70579);const x=(0,h.Gq)("enuseloc"),y=x&&Object.keys(x).length>0?x.user_id:null;console.log("LoginuserId",y);const A={ProjectCategoryName:"",holidayDate:"",statusID:""},C=u.Ik().shape({ProjectCategoryName:u.Yj("Project Category Name").required("Project Category is required"),statusID:u.Ik().nullable().required("Select Status")});const p=function(e){const t=(0,m.zy)(),a=null===t||void 0===t?void 0:t.state,u=null===a||void 0===a?void 0:a._original,[h,x]=(0,s.useState)(!1),y=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],p=s.useRef(null),[I,N]=(0,s.useState)(A),P=(0,d.wA)(),b=(0,m.Zp)();(0,s.useEffect)((()=>{u&&N({...I,ProjectCategoryName:null===u||void 0===u?void 0:u.category_name,statusID:{id:null===u||void 0===u?void 0:u.status,name:null===u||void 0===u?void 0:u.status}})}),[u]);const f=()=>{const{ProjectCategoryName:e,...t}=A;N({...I,...t})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"common-header-label-bold",children:[(0,g.jsx)(r.A,{onClick:()=>{b(-1)},children:(0,g.jsx)(j.A,{})}),"Update Project Category"]}),(0,g.jsx)("div",{className:"component-list",children:(0,g.jsx)(c.l1,{enableReinitialize:!0,innerRef:p,validationSchema:C,initialValues:I,onSubmit:async(e,t)=>{var a,s;const r={categoryID:u.id,categoryName:e.ProjectCategoryName,status:null!==(a=e.statusID)&&void 0!==a&&a.id?null===(s=e.statusID)||void 0===s?void 0:s.id:""};t.setSubmitting(!0),await P((0,v.AR$)(r)),t.resetForm({}),f(),b("/bd-master/ProjectCategory")},children:e=>{let{errors:t,handleSubmit:a,handleChange:s,handleBlur:d,setFieldValue:u,isSubmitting:m,isValid:j,touched:h,values:v}=e;return(0,g.jsx)(c.lV,{onSubmit:a,children:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(n.Ay,{container:!0,className:"component-form",children:(0,g.jsxs)(n.Ay,{container:!0,children:[(0,g.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,g.jsx)(i.A,{fullWidth:!0,label:"Project Category*",name:"ProjectCategoryName",onBlur:d,value:v.ProjectCategoryName,onChange:(e,t)=>{u("ProjectCategoryName",t),N({...I,ProjectCategoryName:e.target.value})},variant:"outlined",size:"small",helperText:h.ProjectCategoryName&&t.ProjectCategoryName,error:h.ProjectCategoryName&&Boolean(t.ProjectCategoryName)})}),(0,g.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,g.jsx)(l.A,{name:"statusID",value:v.statusID,fullWidth:!0,options:y||[],onBlur:d,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,t)=>{u("statusID",t),N({...I,statusID:t})},renderInput:e=>(0,g.jsx)(i.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:t.statusID&&t.statusID,error:t.statusID&&Boolean(t.statusID)})})})]})}),(0,g.jsx)(n.Ay,{className:"d-flex justify-content-center",p:2,children:(0,g.jsx)(o.A,{children:(0,g.jsx)(r.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}},10155:(e,t,a)=>{var s=a(24994);t.A=void 0;var r=s(a(40039)),n=a(70579);t.A=(0,r.default)((0,n.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")},66675:(e,t,a)=>{var s=a(24994);t.A=void 0;var r=s(a(40039)),n=a(70579);t.A=(0,r.default)((0,n.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")}}]);
//# sourceMappingURL=92979.c9164066.chunk.js.map