import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as w}from"./registerWidgets.e46eca28.js";import{e as C,q as h}from"./icons.db549bc5.js";import{a as k}from"./asyncComputed.15fd30e0.js";import{C as x}from"./CrudView.2fb3f52f.js";import"./gateway.0d210a45.js";import"./index.05c509d5.js";import{T as n}from"./tables.072b99a0.js";import"./DropdownMenu.dd15f4e3.js";import"./Modal.47e24ea4.js";import"./LoadingIndicator.623149e9.js";import"./lottie.2b81658b.js";import"./passwordlessManager.f4cc4f94.js";import"./pubsub.8f2ecd1e.js";import"./storage.f303ee10.js";import"./activeRecord.d83b1b14.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]="62347d87-e6bd-4169-9f68-132bd65d4b6a",e._sentryDebugIdIdentifier="sentry-dbid-62347d87-e6bd-4169-9f68-132bd65d4b6a")}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.a8d596c1.js.map
