import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.d68712f0.js";import{f as C,q as h}from"./icons.24d45fbf.js";import{a as k}from"./asyncComputed.f9ea598c.js";import{C as x}from"./CrudView.dbd62bcc.js";import"./gateway.f055664d.js";import"./index.8465c60e.js";import{T as r}from"./tables.255f1caa.js";import"./DropdownMenu.96853481.js";import"./Modal.b6d9a624.js";import"./LoadingIndicator.bd782213.js";import"./lottie.2b6a117e.js";import"./passwordlessManager.36ac2e38.js";import"./pubsub.5d7eaeae.js";import"./activeRecord.b8754928.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]="6f29e227-c165-4504-a43a-5720c4d1ab13",e._sentryDebugIdIdentifier="sentry-dbid-6f29e227-c165-4504-a43a-5720c4d1ab13")}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}})},p=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:b}){t.push({name:"tableEditor",params:{tableId:b,projectId:a}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(a,n.id),d()}}]}]})))!=null?s:[]}}),u=[{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:p.value,fields:u,"create-button-text":"Create Table",onCreate:m},null,8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Tables.4a5cc77f.js.map
