"use strict";(globalThis.webpackChunkwheelsmart_admin_react||=[]).push([[2465],{42465(e,a,i){i.r(a);var r=i(65043),l=i(97508),d=i(22285),s=i(89421),n=i(11645),t=i(68493),o=i(5835),m=i(64124),c=i(47419),h=i(94406),u=i(13069),g=i(70579);const p=(0,l.Ng)(function(e){let{manager:a}=e;return{rowdata:a.rowdata,model:a.model,loading:a.loading,firmList:a.firmList||[]}},{managerAdd:u.zI,isModelVisible:u.q2,InputChangeValue:u.O2,getFirmList:u.lv})(e=>{const[a]=t.A.useForm();(0,r.useEffect)(()=>{e.getFirmList()},[]),(0,r.useEffect)(()=>{var i;a.setFieldsValue({name:e.rowdata.name||"",firm_id:(null===(i=e.rowdata.firm)||void 0===i?void 0:i.id)||e.rowdata.firm_id||void 0})},[e.rowdata]);return(0,g.jsx)(m.A,{visible:e.model,title:(0,g.jsxs)("h5",{className:"modal-title",children:[e.rowdata.id?"Update":"Add"," Manager"]}),onCancel:()=>{a.resetFields(),e.isModelVisible(!1)},footer:(0,g.jsxs)(c.A,{justify:"center",children:[(0,g.jsx)(n.A,{span:12,className:"hp-pr-4",children:(0,g.jsx)(s.A,{onClick:()=>e.isModelVisible(!1),type:"primary",block:!0,ghost:!0,children:"Cancel"})}),(0,g.jsx)(n.A,{span:12,className:"hp-pl-4",children:(0,g.jsx)(s.A,{loading:e.loading,onClick:()=>a.submit(),type:"primary",block:!0,children:e.rowdata.id?"Update":"Add"})})]}),centered:!0,closeIcon:(0,g.jsx)(d.dCQ,{className:"remix-icon text-color-black-100",size:24}),width:500,children:(0,g.jsxs)(t.A,{layout:"vertical",form:a,onFinish:()=>{var a;e.managerAdd({id:(null===(a=e.rowdata)||void 0===a?void 0:a.id)||0,name:e.rowdata.name,firm_id:e.rowdata.firm_id})},children:[(0,g.jsx)(t.A.Item,{label:"Name",name:"name",rules:[{required:!0,message:"Please enter Name!"}],children:(0,g.jsx)(o.A,{placeholder:"Enter Manager Name",onChange:a=>e.InputChangeValue({key:"name",value:a.target.value})})}),(0,g.jsx)(t.A.Item,{label:"Firm",name:"firm_id",rules:[{required:!0,message:"Please select Firm!"}],children:(0,g.jsx)(h.A,{showSearch:!0,placeholder:"Select Firm",filterOption:(e,a)=>a.children.toLowerCase().includes(e.toLowerCase()),onChange:a=>e.InputChangeValue({key:"firm_id",value:a}),children:(e.firmList||[]).map(e=>(0,g.jsx)(h.A.Option,{value:e.id,children:e.name},e.id))})})]})})});i.d(a,["default",0,p])}}]);
//# sourceMappingURL=2465.dc60a626.chunk.js.map