import{aT as u,l as h,k as x,j as e,E as j,a9 as n}from"./app-BgLa5dit.js";import{M as p}from"./DwzYo0zp.chunk.js";function S({catalogName:r,fieldName:t,region:a,closePopup:s}){const[i,o]=u.useState(!1),l=h(),c=x();async function d(){o(!0),c(p.deleteField(r,t,a)).then(()=>l.success(`Successfully deleted catalog field: ${t}`)).catch(()=>l.error(`Failed to delete catalog field: ${t}. Please try again.`)).finally(s)}return e.jsx(j,{title:"Delete Field",closePopup:s,showLoadingSpinner:!t,children:!!t&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to delete the field ",e.jsx("strong",{children:t}),"?"]}),e.jsxs("p",{children:["This will ",e.jsx("strong",{children:"permanently"})," delete the catalog field and cannot be undone."]}),e.jsxs(n,{children:[e.jsx(n.Cancel,{onClick:s}),e.jsx(n.Submit,{showSpinner:i,onClick:d,variant:"danger",text:"Delete Field"})]})]})})}export{S as DeleteFieldView};
//# sourceMappingURL=CvgfzcIx.chunk.js.map
