import{u,r as h,j as e,e as g}from"./vendor-BKmmeuxg.js";import{B as a}from"./button-BpNwv2aE.js";import{D as j,a as b,b as v}from"./dialog-B2gN9MvT.js";import{c as f}from"./utils-DxSsnXxD.js";const S=n=>{const o=u(),{button:r,frontend:c}=o.props.translate,{message:t,routePath:l,actionComponent:i}=n,[d,s]=h.useState(!1),p=()=>{s(m=>!m)},x=()=>{g.delete(l,{preserveScroll:!0,onSuccess:()=>{s(!1)}})};return e.jsxs(j,{open:d,onOpenChange:s,children:[e.jsx(b,{asChild:!0,children:i}),e.jsxs(v,{className:f("px-6 py-8 sm:max-w-[425px]",t?"space-y-4":"space-y-8"),children:[e.jsx("h6",{className:"text-destructive text-center text-xl",children:c.delete_warning}),t&&e.jsx("div",{className:"bg-destructive/5 rounded-xl p-4",children:e.jsx("p",{className:"text-destructive text-center text-sm",children:t})}),e.jsxs("div",{className:"mb-0 flex items-center justify-center gap-6",children:[e.jsx(a,{onClick:p,className:"text-destructive border-destructive border bg-transparent px-5 hover:bg-transparent",children:r.cancel}),e.jsx(a,{type:"button",onClick:x,className:"hover:bg-primary-hover bg-primary px-5",children:r.delete})]})]})]})};export{S as D};
