import{lt as e,n as t}from"./render-cqdoDfd9.js";import{t as o}from"./Button-D-nJohaT.js";import{t as a}from"./DialogActions-IskUXpPi.js";import{n as s,t as n}from"./DialogTitle-HCb6VQhm.js";import{t as i}from"./DialogContentText-EZ4FAf5e.js";import{t as r}from"./utils-C0ZHLGh_.js";var c=e(),l=({courseId:e,action:l,courseTitle:d,handleClose:m,handleSuccess:h})=>{const j=localStorage.getItem("activeOrganizationId"),{localeMessages:p,apiBaseUrl:g}=t();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n,{id:"alert-dialog-title",children:p[`${l}_course`].replace("COURSE_NAME",d)}),(0,c.jsx)(s,{children:(0,c.jsx)(i,{id:"alert-dialog-description",children:p[`course_${l}_confirmation`].replace("COURSE_NAME",d)})}),(0,c.jsxs)(a,{children:[(0,c.jsx)(o,{onClick:m,children:p.cancel}),(0,c.jsx)(o,{onClick:()=>{fetch(`${g}/organizations/${j}/courses/${e}/`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":r("csrftoken")},body:JSON.stringify({enabled:"enable"===l,image:"SKIP"})}).then(e=>e.json()).then(e=>{h(e),m()}).catch(e=>{})},autoFocus:!0,variant:"contained",children:p.continue})]})]})};export{l as default};