import{R as h,aP as j,l as P,F as A,j as a,bA as w,E as L,b7 as l,a9 as r,y as p,aQ as T}from"./app-BgLa5dit.js";import{C as y}from"./Cgoejc6d.chunk.js";import{D as c}from"./DEF_vJGe.chunk.js";import{D as $}from"./BE59vaMU.chunk.js";import{u as B}from"./kHNgJL0M.chunk.js";import"./KIVqng-q.chunk.js";const m="shared.archiveDraftDashboard",o=A.encloseNamespace(m);function I(e){const t=e.toLocaleLowerCase();return{title:`${t}Title`,heading:`${t}Heading`,success:`${t}Success`,error:`${t}Error`,areYouSure:`${t}AreYouSure`}}function N(e){return{variant:e===c.Archive?"danger":"dark",text:e}}function R(e){switch(e){case c.Archive:return p.Archived;case c.Draft:return p.Draft}}function Q(e){const[t,x]=h.useState(!1),[g,b]=h.useState(!1),f=j(),i=P(),n=B(e.dashboardId),s=I(e.actionType),u=N(e.actionType),S=R(e.actionType);function C(){x(!0),T(f,$.updateDashboard(e.dashboardId,{...n.data,status:S},()=>i.success(o(s.success)),()=>i.error(o(s.error)),e.closePopup))}const D=o(s.title),d=!!n.data;return a.jsx(w.Provider,{value:m,children:a.jsx(L,{title:D,closePopup:e.closePopup,showLoadingSpinner:!d,children:d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{children:a.jsx(l,{phrase:s.areYouSure})}),a.jsx("div",{className:"mt-2",children:a.jsx(l,{phrase:s.heading})}),a.jsx(y,{challengePhrase:n.data.name,onChallengePass:v=>b(v)}),a.jsxs(r,{className:"mt-3",children:[a.jsx(r.Cancel,{onClick:e.closePopup}),a.jsx(r.Submit,{variant:u.variant,onClick:C,text:u.text,showSpinner:t,disabled:!g})]})]})})})}export{Q as ArchiveDraftDashboardView};
//# sourceMappingURL=BQivUYra.chunk.js.map
