import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.fc9d5fd6.js";import{f as C,q as h}from"./icons.c6cfa25a.js";import{a as k}from"./asyncComputed.11711b1c.js";import{C as x}from"./CrudView.953ef02c.js";import"./gateway.f6e58b0b.js";import"./index.8156127b.js";import{T as r}from"./tables.0e12f10b.js";import"./DropdownMenu.8705b40e.js";import"./Modal.17f7550f.js";import"./LoadingIndicator.74296734.js";import"./lottie.762956c5.js";import"./passwordlessManager.db68ed1a.js";import"./pubsub.44274034.js";import"./activeRecord.63df8b13.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]="b81e16d1-8a7d-4ec6-82b6-ee72973c4ab8",e._sentryDebugIdIdentifier="sentry-dbid-b81e16d1-8a7d-4ec6-82b6-ee72973c4ab8")}catch{}})();const H=f({__name:"Tables",setup(e){const t=y(),a=_().params.projectId,{loading:i,result:c,refetch:d}=k(()=>r.list(a)),m=async o=>{const s=await r.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(n=>({key:n.id,cells:[{text:n.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 n.delete(a,n.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{H as default};
//# sourceMappingURL=Tables.d52cb6ed.js.map
