import{l as d,R as S,k as v,j as s,E as C,a9 as a}from"./app-BgLa5dit.js";import{M as e}from"./DeKZULrh.chunk.js";import{C as h}from"./q-IBKcuF.chunk.js";import"./DUpYPoLs.chunk.js";import"./EZim8aq-.chunk.js";import"./BD9MrUJP.chunk.js";import"./s6cGcwlA.chunk.js";import"./Zwjmkasg.chunk.js";import"./4qGb1BIY.chunk.js";import"./DnXDEnAR.chunk.js";import"./DpUpv6rY.chunk.js";import"./CG7zbly5.chunk.js";import"./m4aqaK_l.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";function V(t){const o=d(),[c,r]=S.useState(!1),i=v();async function n(u,l){const p=l===e.Active?e.Disabled:e.Active;await i(h.updateCustomerStatus(u,p))}async function m(){try{r(!0),await n(t.id,t.currentStatus),r(!1),o.success("Customer status updated.")}catch{o.error("Failed to update customer status.")}finally{t.closePopup()}}return s.jsxs(C,{title:t.currentStatus===e.Active?"Deactivate customer":"Reactivate customer",closePopup:t.closePopup,children:[s.jsx("p",{children:t.currentStatus===e.Active?"Are you sure you want to deactivate this customer? They will no longer be able to access ClickView.":"Are you sure you want to reactivate this customer?"}),s.jsxs(a,{className:"bulk-action-modal-buttons",children:[s.jsx(a.Cancel,{onClick:t.closePopup,text:"Cancel"}),s.jsx(a.Submit,{text:t.currentStatus===e.Active?"Deactivate customer":"Reactivate customer",variant:"danger",showSpinner:c,onClick:m})]})]})}export{V as UpdateCustomerMasterStatusView};
//# sourceMappingURL=CuYLHG5b.chunk.js.map
