import{d as f,ez as y,eA as _,J as g,b as I,c as T,u as h}from"./outputWidgets.eddbac36.js";import{e as k,p as w}from"./icons.08aaa24c.js";import{a as C}from"./asyncComputed.fbd351ba.js";import"./console.56ba8e89.js";import"./index.c1e978a8.js";import{T as n}from"./tables.d8fc7e3d.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.d009f8f3.js";import"./index.cc18f239.js";import"./Form.f5163eed.js";import"./Title.7ca27be1.js";import"./index.1a0ec4ff.js";import"./index.31447910.js";import"./index.9c583b89.js";import"./dayjs.d80a3524.js";import"./index.8318ec36.js";import"./index.8b693270.js";import"./TabPane.05333dfb.js";import"./index.b6a61078.js";import"./index.7a28d537.js";import"./index.d099a09e.js";import"./index.933610ff.js";import"./index.2c51d0a8.js";import"./index.b131e8f9.js";import"./index.3475d619.js";import"./index.f428cf3a.js";import"./gateway.e4ec4a58.js";import"./activeRecord.64b754df.js";import"./pubsub.9aea5614.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]="ba82480f-116e-4a9a-bb94-04542f51db2e",t._sentryDebugIdIdentifier="sentry-dbid-ba82480f-116e-4a9a-bb94-04542f51db2e")}catch{}})();const ee=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:m,result:l,refetch:p}=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}})},c=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),p()}}]}]})))!=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:c.value,fields:b,"create-button-text":"Create Table",onCreate:d},null,8,["loading","table"]))}});export{ee as default};
//# sourceMappingURL=Tables.f7dc28c4.js.map
