import{j as e}from"./tanstack-1.0.74-aU0azVkW.js";import{r as l}from"./redux-1.0.74-D8bIc6ki.js";import{i as j}from"./index-1.0.74-DxwH6OqZ.js";import{l as g}from"./lib-1.0.74-B5IEqfHg.js";import{C}from"./ConfirmDialog-1.0.74-CXu4CqK2.js";import{A as M,v as b}from"./index-1.0.74-8lphm33F.js";import{I as D}from"./iconBase-1.0.74-Cs0vntJu.js";import{M as E}from"./Menu-1.0.74-CdjCBJ4R.js";import{M as a}from"./MenuItem-1.0.74-D9LDbFUb.js";import"./vendor-1.0.74-CN03Eozo.js";import"./CircularProgress-1.0.74-QfwfRJ7i.js";import"./ButtonBase-1.0.74-W6tAH7AI.js";import"./Typography-1.0.74-B4mhsevh.js";import"./useEnhancedEffect-1.0.74-B56M26dS.js";import"./ThemeProvider-1.0.74-4uzbYYLM.js";import"./Portal-1.0.74-BrUPeMX9.js";import"./utils-1.0.74-7xWhx9mc.js";import"./AdminTheme-1.0.74-BtTaJUu_.js";import"./Modal-1.0.74-BfLid1bk.js";import"./isHostComponent-1.0.74-DVu5iVWx.js";const J=({index:r,computedField:p,prepareComputedFieldUpdate:m,deleteComputedField:d})=>{g.debug(r,p);const[i,t]=l.useState(null),n=!!i,c=o=>{t(o.currentTarget),o.stopPropagation()},u=()=>{t(null)},f=o=>{m(r),t(null),o.stopPropagation()},h=o=>{s(!0),t(null),o.stopPropagation()},[x,s]=l.useState(!1);return e.jsxs("div",{children:[e.jsx(D,{id:"pp-computed-field-more-button","aria-controls":n?"pp-computed-field-more-menu":void 0,"aria-haspopup":"true","aria-expanded":n?"true":void 0,onClick:c,children:e.jsx(j,{})}),e.jsxs(E,{id:"pp-computed-field-more-menu",anchorEl:i,open:n,onClose:u,MenuListProps:{"aria-labelledby":"pp-computed-field-more-button"},sx:{zIndex:9999999999},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:[e.jsxs(a,{onClick:f,children:[e.jsx(M,{}),e.jsx("span",{style:{marginLeft:"10px"},children:"Edit"})]}),e.jsxs(a,{onClick:h,children:[e.jsx(b,{}),e.jsx("span",{style:{marginLeft:"10px"},children:"Delete"})]})]}),e.jsx(C,{title:"Delete computed field?",message:"Are you sure you want to delete this computed field? This action cannot be undone!",open:x,setOpen:s,onConfirm:()=>d(r)})]})};export{J as default};
