import{r as c,V as x,j as s,B as a,f as h,S as b,n as k}from"./index-f9c70843.js";const j=({children:e})=>s.jsx("div",{className:"h-full w-full",children:e}),m=({children:e,tooltipContent:n,side:r})=>n?s.jsx(b,{side:r,content:n,children:s.jsx("div",{className:"h-full w-full",children:e})}):s.jsx("div",{className:"h-full w-full",children:e});function g({title:e,titleHeader:n,modalContentTitle:r,cancelText:p,confirmationText:C,children:d,destructive:N=!1,icon:v,data:w,index:y,onConfirm:E,size:B,open:t,onClose:o,onCancel:f}){const M=k[v],[u,l]=c.useState(t??!1);c.useEffect(()=>{t&&l(t)},[t]),c.useEffect(()=>{o&&o(u)},[u]);const O=x.Children.toArray(d).find(i=>i.type===m),S=x.Children.toArray(d).find(i=>i.type===j);return s.jsxs(a,{size:B,open:t,setOpen:l,children:[s.jsx(a.Trigger,{children:O}),s.jsxs(a.Header,{description:n??null,children:[s.jsx("span",{className:"pr-2",children:e}),s.jsx(M,{name:"icon",className:"h-6 w-6 pl-1 text-foreground","aria-hidden":"true"})]}),s.jsxs(a.Content,{children:[r&&r!=""&&s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:r}),s.jsx("br",{})]}),S]}),s.jsxs(a.Footer,{children:[s.jsx(h,{className:"ml-3",variant:N?"destructive":"default",onClick:()=>{l(!1),E(y,w)},"data-testid":"replace-button",children:C}),s.jsx(h,{className:"",variant:"outline",onClick:()=>{f&&f(),l(!1)},children:p})]})]})}g.Content=j;g.Trigger=m;export{g as C};
