import{R as g,aP as j,l as f,o as i,j as e,E as b,a9 as r,aQ as y}from"./app-BgLa5dit.js";import{P as t}from"./DUyf8veO.chunk.js";function S(s){const[c,h]=g.useState(!1),u=j(),n=f(),a=i(t.dashboardWidget(s.dashboardId,s.widgetId)),o=i(t.dashboard(s.dashboardId)),d=i(!!a.data&&t.playlist(a.data.collectionId)),l=!!a.data&&!!o.data&&!!d.data;function m(){h(!0);const p=()=>{n.success("Successfully removed playlist from dashboard")},x=()=>{n.error("Failed to remove playlist from dashboard")};y(u,t.deleteWidget(o.data.id,a.data.id,d.data.id,p,x,s.closePopup))}return e.jsx(b,{title:"Remove playlist from dashboard",closePopup:s.closePopup,showLoadingSpinner:!l,children:!!l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("p",{children:["Are you sure you want to remove ",e.jsx("strong",{children:d.data.name})," from ",e.jsx("strong",{children:o.data.name}),"?"]}),e.jsx("p",{children:e.jsx("em",{children:"Note: This is the same as deleting the widget from the dashboard."})})]}),e.jsxs(r,{children:[e.jsx(r.Cancel,{onClick:s.closePopup}),e.jsx(r.Submit,{variant:"danger",onClick:m,text:"Yes, remove playlist",showSpinner:c})]})]})})}export{S as DeleteDashboardWidgetView};
//# sourceMappingURL=DGPeh60j.chunk.js.map
