"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),v=t(96801),y=(t(17115),t(70579));const x=(0,v.Gq)("enuseloc"),C=x&&Object.keys(x).length>0?x.user_id:null;console.log("LoginuserId",C);const A={courtCaseTypeName:"",statusID:""},j=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,v]=(0,a.useState)(!1),x=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],C=a.useRef(null),[T,I]=(0,a.useState)(A),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}=A;I({...T,...s})};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"common-header-label-bold",children:[(0,y.jsx)(n.A,{onClick:()=>{g(-1)},children:(0,y.jsx)(p.A,{})}),"Update Court Case Type"]}),(0,y.jsx)("div",{className:"component-list",children:(0,y.jsx)(u.l1,{enableReinitialize:!0,innerRef:C,validationSchema:j,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:v}=e;return(0,y.jsx)(u.lV,{onSubmit:t,children:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,y.jsxs)(l.Ay,{container:!0,children:[(0,y.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,y.jsx)(r.A,{fullWidth:!0,label:"Case Type Name*",name:"courtCaseTypeName",onBlur:c,value:v.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,y.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,y.jsx)(i.A,{name:"statusID",value:v.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,y.jsx)(r.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:s.statusID&&s.statusID,error:s.statusID&&Boolean(s.statusID)})})})]})}),(0,y.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,y.jsx)(o.A,{children:(0,y.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}},10155:(e,s,t)=>{var a=t(24994);s.A=void 0;var n=a(t(40039)),l=t(70579);s.A=(0,n.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=86417.8c4b0058.chunk.js.map