import{d as f,ez as y,eA as _,J as g,b as I,c as T,u as h}from"./outputWidgets.d6897520.js";import{e as k,p as w}from"./icons.20b5fc8a.js";import{a as C}from"./asyncComputed.2c363ccc.js";import"./console.526446d9.js";import"./index.a8a303e6.js";import{T as n}from"./tables.7020bedd.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.eece189e.js";import"./index.40bea6c2.js";import"./Form.a2bccbf0.js";import"./Title.9e102f51.js";import"./index.65fddafd.js";import"./index.dcf9fd0a.js";import"./index.09e1dc09.js";import"./dayjs.dccbdd6f.js";import"./index.0f5fc52a.js";import"./index.fd09b35e.js";import"./TabPane.c8258ec5.js";import"./index.b11f642a.js";import"./index.7c1a9101.js";import"./index.e63bacfa.js";import"./index.30191c77.js";import"./index.33e7eca5.js";import"./index.16598f32.js";import"./index.a2784b6b.js";import"./index.59123055.js";import"./gateway.c13063b9.js";import"./activeRecord.e97440b4.js";import"./pubsub.e0b33cd4.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]="2d59227b-d38c-42ec-96c4-60cdfdcb6124",t._sentryDebugIdIdentifier="sentry-dbid-2d59227b-d38c-42ec-96c4-60cdfdcb6124")}catch{}})();const ee=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:m,result:l,refetch:c}=C(()=>n.list(e)),d=async o=>{const r=await n.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=l.value)==null?void 0:o.map(i=>({key:i.id,cells:[{text:i.name,link:{name:"tableEditor",params:{tableId:i.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 i.delete(e,i.id),c()}}]}]})))!=null?r:[]}}),b=[{key:"name",label:"Table name",type:"text"}];return(o,r)=>(I(),T(x,{"entity-name":"table",loading:h(m),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{ee as default};
//# sourceMappingURL=Tables.12a45095.js.map
