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