import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.59747b32.js";import{f as C,q as h}from"./icons.8e518be5.js";import{a as k}from"./asyncComputed.1d4b957f.js";import{C as x}from"./CrudView.37ea6d3f.js";import"./gateway.6a881856.js";import"./index.e8afc474.js";import{T as n}from"./tables.54581045.js";import"./DropdownMenu.7b5d814a.js";import"./Modal.9da25f39.js";import"./LoadingIndicator.04199c7c.js";import"./lottie.15d20c75.js";import"./passwordlessManager.794d3db6.js";import"./pubsub.cfb8c19f.js";import"./storage.e0256989.js";import"./activeRecord.e2c0e940.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]="a53705cb-422f-4ab2-b745-0ee248e3fc5e",e._sentryDebugIdIdentifier="sentry-dbid-a53705cb-422f-4ab2-b745-0ee248e3fc5e")}catch{}})();const J=f({__name:"Tables",setup(e){const t=y(),a=_().params.projectId,{loading:i,result:c,refetch:d}=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=c.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),d()}}]}]})))!=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.b6d4883c.js.map
