import{u as j,j as a,B as r}from"./index-O0BQoyzo.js";import{r as n}from"./react-Cb2sDjhD.js";import{D as y,a as D,b,c as g,d as h,e as p}from"./dialog-bAIDaO-6.js";function C({open:c,onOpenChange:t,title:d,description:e,confirmLabel:u,cancelLabel:f,intent:m="default",onConfirm:l}){const{t:i}=j("common"),[s,o]=n.useState(!1),x=n.useCallback(async()=>{o(!0);try{await l(),t(!1)}catch{}finally{o(!1)}},[l,t]);return a.jsx(y,{open:c,onOpenChange:s?()=>{}:t,children:a.jsxs(D,{children:[a.jsxs(b,{children:[a.jsx(g,{children:d}),e&&a.jsx(h,{children:e})]}),a.jsxs(p,{children:[a.jsx(r,{type:"button",variant:"secondary",onClick:()=>t(!1),disabled:s,children:f??i("actions.cancel")}),a.jsx(r,{type:"button",variant:m==="danger"?"destructive":"default",onClick:x,disabled:s,"aria-busy":s,children:s?i("states.saving"):u??i("actions.confirm")})]})]})})}C.displayName="ConfirmDialog";export{C};
//# sourceMappingURL=confirm-dialog-DmJq4Td9.js.map
