import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as h}from"./registerWidgets.9fce82a0.js";import{e as k,p as w}from"./icons.1992e13b.js";import{a as x}from"./asyncComputed.a4b709a3.js";import"./gateway.6deb8468.js";import"./index.75e03e08.js";import{T as s}from"./tables.5923bae8.js";import{_ as C}from"./CrudView.vue_vue_type_script_setup_true_lang.ac5a77d6.js";import"./passwordlessManager.eda842b8.js";import"./pubsub.025cc397.js";import"./storage.ae287dfa.js";import"./activeRecord.872f4269.js";import"./index.2c964e80.js";import"./Title.26974edb.js";import"./Form.413853c0.js";import"./index.eed9c711.js";import"./index.30c35b37.js";import"./index.c9f7f8f0.js";import"./index.db5cf0e6.js";import"./index.e8158c16.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]="67d48293-ecba-4ad5-9451-4b2954dd5994",t._sentryDebugIdIdentifier="sentry-dbid-67d48293-ecba-4ad5-9451-4b2954dd5994")}catch{}})();const P=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:l,result:d,refetch:m}=x(()=>s.list(e)),c=async o=>{const r=await s.create(e,o.name);a.push({name:"tableEditor",params:{tableId:r.id,projectId:e}})},p=g(()=>{var o,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(o=d.value)==null?void 0:o.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:e}}},{text:"Actions",actions:[{icon:k,label:"Edit Table",onClick({key:u}){a.push({name:"tableEditor",params:{tableId:u,projectId:e}})}},{icon:w,label:"Delete",dangerous:!0,async onClick(){await n.delete(e,n.id),m()}}]}]})))!=null?r:[]}}),b=[{key:"name",label:"Table name",type:"text"}];return(o,r)=>(I(),T(C,{"entity-name":"table",loading:h(l),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:p.value,fields:b,"create-button-text":"Create Table",onCreate:c},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Tables.50d1d6fa.js.map
