import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.daf4e0d4.js";import{f as C,q as h}from"./icons.74a49ba5.js";import{a as k}from"./asyncComputed.ea0509ca.js";import{C as x}from"./CrudView.6743e372.js";import"./gateway.c1bf584f.js";import"./index.1451144e.js";import{T as n}from"./tables.6882d651.js";import"./DropdownMenu.e36b430d.js";import"./Modal.041843ec.js";import"./LoadingIndicator.465c522f.js";import"./lottie.1c3e1229.js";import"./passwordlessManager.cc6b1127.js";import"./pubsub.bf966380.js";import"./storage.62ab7605.js";import"./activeRecord.8789da8d.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="09b467be-a88d-403e-a408-584fa8a6939d",e._sentryDebugIdIdentifier="sentry-dbid-09b467be-a88d-403e-a408-584fa8a6939d")}catch{}})();const J=f({__name:"Tables",setup(e){const t=y(),a=_().params.projectId,{loading:i,result:d,refetch:c}=k(()=>n.list(a)),m=async o=>{const s=await n.create(a,o.name);t.push({name:"tableEditor",params:{tableId:s.id,projectId:a}})},b=g(()=>{var o,s;return{columns:[{name:"Table Name"},{name:"Table Actions"}],rows:(s=(o=d.value)==null?void 0:o.map(r=>({key:r.id,cells:[{text:r.name,classes:["title","centered"]},{text:"Actions",classes:["centered"],actions:[{icon:C,label:"Edit Table",onClick({key:u}){t.push({name:"tableEditor",params:{tableId:u,projectId:a}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await r.delete(a,r.id),c()}}]}]})))!=null?s:[]}}),p=[{key:"name",label:"Table name",type:"text"}];return(o,s)=>(I(),T(x,{"entity-name":"table",loading:w(i),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:b.value,fields:p,"create-button-text":"Create Table",onCreate:m},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Tables.cfe38b26.js.map
