import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as k}from"./registerWidgets.5ceb46ef.js";import{e as w,o as h}from"./icons.b59fe784.js";import{a as x}from"./asyncComputed.fd157db2.js";import"./gateway.fadd845e.js";import"./index.e1d2843e.js";import{T as s}from"./tables.6bacb34c.js";import{_ as C}from"./CrudView.vue_vue_type_script_setup_true_lang.af549d55.js";import"./passwordlessManager.db35a950.js";import"./pubsub.451b7de0.js";import"./storage.4e9cf889.js";import"./activeRecord.693e9703.js";import"./Modal.4e47c5c5.js";import"./Title.d4cb8bc4.js";import"./index.1a41b32a.js";import"./index.f7704414.js";import"./index.4fdcdf65.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="0038a2f5-a65a-4971-8ca1-b039a84ba3bf",t._sentryDebugIdIdentifier="sentry-dbid-0038a2f5-a65a-4971-8ca1-b039a84ba3bf")}catch{}})();const K=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:l,result:m,refetch:c}=x(()=>s.list(e)),d=async o=>{const n=await s.create(e,o.name);a.push({name:"tableEditor",params:{tableId:n.id,projectId:e}})},b=g(()=>{var o,n;return{columns:[{name:"Table Name"},{name:"Table Actions"}],rows:(n=(o=m.value)==null?void 0:o.map(r=>({key:r.id,cells:[{text:r.name,link:{name:"tableEditor",params:{tableId:r.id,projectId:e}}},{text:"Actions",actions:[{icon:w,label:"Edit Table",onClick({key:u}){a.push({name:"tableEditor",params:{tableId:u,projectId:e}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await r.delete(e,r.id),c()}}]}]})))!=null?n:[]}}),p=[{key:"name",label:"Table name",type:"text"}];return(o,n)=>(I(),T(C,{"entity-name":"table",loading:k(l),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:d},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Tables.44734bef.js.map
