import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as h}from"./registerWidgets.4340e287.js";import{e as k,p as w}from"./icons.da02f7f7.js";import{a as x}from"./asyncComputed.a4cc4ebe.js";import"./gateway.1f2ccdb0.js";import"./index.dbce76fa.js";import{T as s}from"./tables.2aa1491d.js";import{_ as C}from"./CrudView.vue_vue_type_script_setup_true_lang.e9f57b5e.js";import"./passwordlessManager.8c70219b.js";import"./pubsub.3290d859.js";import"./storage.dfe55847.js";import"./activeRecord.c40ac301.js";import"./index.f58e2ef8.js";import"./Title.4165770a.js";import"./Form.7b78c348.js";import"./index.17a2edf7.js";import"./index.7bc7e814.js";import"./index.d24f6130.js";import"./index.9aade351.js";import"./index.c13b703c.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]="836c5f04-ea34-4b67-ba81-760a61f343ca",t._sentryDebugIdIdentifier="sentry-dbid-836c5f04-ea34-4b67-ba81-760a61f343ca")}catch{}})();const P=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 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=m.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),c()}}]}]})))!=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:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Tables.82fb0401.js.map
