import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.2d3a9fa1.js";import{f as C,q as h}from"./icons.ef35efa7.js";import{a as k}from"./asyncComputed.da67dddd.js";import{C as x}from"./CrudView.a779dd60.js";import"./gateway.90839648.js";import"./index.cc19b71e.js";import{T as n}from"./tables.fc9f733e.js";import"./DropdownMenu.1c4bd517.js";import"./Modal.0a34e3f8.js";import"./LoadingIndicator.25e4e865.js";import"./lottie.8f8e4fb5.js";import"./passwordlessManager.7fdb47fd.js";import"./pubsub.f5cc447b.js";import"./storage.2f9edc3d.js";import"./activeRecord.85525a95.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]="20074ff3-1a4a-4847-8daa-c2b2ad3dd1d5",e._sentryDebugIdIdentifier="sentry-dbid-20074ff3-1a4a-4847-8daa-c2b2ad3dd1d5")}catch{}})();const J=f({__name:"Tables",setup(e){const t=y(),a=_().params.projectId,{loading:d,result:i,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}})},p=g(()=>{var o,s;return{columns:[{name:"Table Name"},{name:"Table Actions"}],rows:(s=(o=i.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:b}){t.push({name:"tableEditor",params:{tableId:b,projectId:a}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await r.delete(a,r.id),c()}}]}]})))!=null?s:[]}}),u=[{key:"name",label:"Table name",type:"text"}];return(o,s)=>(I(),T(x,{"entity-name":"table",loading:w(d),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{J as default};
//# sourceMappingURL=Tables.b9a524fc.js.map
