import{j as t,S as u,h as d,a1 as p}from"./vendor-ClLR6ncd.js";import{d as f}from"./CheckCircle-DkZpQ8Yc.js";import{d as h}from"./Cancel-BcN7wjUl.js";import{h as b,i as x,f as j}from"./index-OtVJl4GC.js";import"./lodash-ZyeDnt0e.js";import{R as y,a as R,T}from"./index-BfX6clXf.js";import"./index-DrNOqnsN.js";import"./ResponsiveContainer-vqCYnvBi.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./OptionallyDenseMuiTable-D7b58l1V.js";import"./TableContainer-CN5gAdqf.js";import"./TableRow-CGDSOtFZ.js";import"./TableSortLabel-BJFq2axQ.js";import"./RefreshDataButton-BMv_Vwgi.js";function c(a,o={}){return b((e,s)=>x({url:j(s,a),method:"post",params:{xid:e,...o}}),{invalidateRepoKeysOnSettled:[]})}function k({label:a,type:{columns:o},value:e}){const s=c("commit",{phase:"commit"}),i=c("rollback");if(!o)return t.jsxs(u,{spacing:1,children:[t.jsx(R,{label:a}),t.jsx(d,{children:"The table is empty"})]});const m=o.concat({label:"Commit",sortable:!1},{label:"Rollback",sortable:!1}),n=s.isLoading||i.isLoading,l=e.map(r=>r.concat(t.jsx(p,{disabled:n,onClick:()=>s.mutate(r[0]),children:t.jsx(f,{})}),t.jsx(p,{disabled:n,onClick:()=>i.mutate(r[0]),children:t.jsx(h,{})})));return t.jsx(T,{label:a,type:{columns:m},value:l})}const M=(a,o)=>{if(o==="Prepared two-phase commits")return k};function O(){return t.jsx(y,{path:"transactions",title:"Active transactions",reportType2Component:M})}export{O as default};
