import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.4423f919.js";import{f as C,q as h}from"./icons.83f94343.js";import{a as k}from"./asyncComputed.39878ec5.js";import{C as x}from"./CrudView.5fe8a1fb.js";import"./gateway.863d6849.js";import"./index.3e13a4a5.js";import{T as n}from"./tables.b8117de4.js";import"./DropdownMenu.6406574f.js";import"./Modal.a1d02dc5.js";import"./LoadingIndicator.5602929a.js";import"./lottie.4638634c.js";import"./passwordlessManager.c1306433.js";import"./pubsub.7260b9d2.js";import"./storage.f7ed9f01.js";import"./activeRecord.9d71c559.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]="341b28e7-2b4e-4b27-8f37-7eafb2733fad",e._sentryDebugIdIdentifier="sentry-dbid-341b28e7-2b4e-4b27-8f37-7eafb2733fad")}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.3dc56a79.js.map
