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