import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.92d2f644.js";import{f as C,q as h}from"./icons.f7e2c66d.js";import{a as k}from"./asyncComputed.969e5e52.js";import{C as x}from"./CrudView.bf94fe37.js";import"./gateway.b5fd6e0f.js";import"./index.a8106eac.js";import{T as n}from"./tables.96ab32f3.js";import"./DropdownMenu.737d17d7.js";import"./Modal.2ef1e90a.js";import"./LoadingIndicator.6e991a44.js";import"./lottie.8475a642.js";import"./passwordlessManager.d1484834.js";import"./pubsub.cabffe13.js";import"./storage.63ab52ef.js";import"./activeRecord.1a640186.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]="7ac8bf4d-8a7d-47fe-97ba-dc36149314d5",e._sentryDebugIdIdentifier="sentry-dbid-7ac8bf4d-8a7d-47fe-97ba-dc36149314d5")}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.b2600fa8.js.map
