"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:()=>d});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,{})})},d=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)),d=s(14556),c=s(73033),m=s(73216),h=s(66675),v=s(11852),S=s(96801),x=(s(17115),s(70579));const C=(0,S.Gq)("enuseloc"),A=C&&Object.keys(C).length>0?C.user_id:null;console.log("LoginuserId",A);const j={courtCaseStatusName:"",statusID:""},p=c.Ik().shape({courtCaseStatusName:c.Yj("Enter Status Name").required("Status Name is required"),statusID:c.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[c,S]=(0,a.useState)(!1),C=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],A=a.useRef(null),[I,g]=(0,a.useState)(j),N=(0,d.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}=j;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:A,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,v.MgT)(l)),f(),b("/bd-masters/CourtCaseStatus")},children:e=>{let{errors:t,handleSubmit:s,handleChange:a,handleBlur:d,setFieldValue:c,isSubmitting:m,isValid:h,touched:v,values:S}=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:d,value:S.courtCaseStatusName,onChange:(e,t)=>{c("courtCaseStatusName",t),g({...I,courtCaseStatusName:e.target.value})},variant:"outlined",size:"small",helperText:v.courtCaseStatusName&&t.courtCaseStatusName,error:v.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:S.statusID,fullWidth:!0,options:C||[],onBlur:d,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,t)=>{c("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"})})})]})})}})})]})}},10155:(e,t,s)=>{var a=s(24994);t.A=void 0;var n=a(s(40039)),l=s(70579);t.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=80091.5dad3196.chunk.js.map