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