import{d as f,ez as y,eA as _,J as g,b as I,c as T,u as h}from"./outputWidgets.52de64cd.js";import{e as k,q as w}from"./icons.bf6505eb.js";import{a as C}from"./asyncComputed.00e76dd1.js";import"./console.4411c7a7.js";import"./index.8361ad88.js";import{T as n}from"./tables.2760999e.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.70304edb.js";import"./index.a07ffcc5.js";import"./Form.09072055.js";import"./Title.baba2b21.js";import"./index.7800af0b.js";import"./index.c0e74c90.js";import"./index.e5d92658.js";import"./dayjs.7ad6aa6d.js";import"./index.5718341d.js";import"./index.3ed5d65c.js";import"./TabPane.c3c2f5a1.js";import"./index.396ff1b5.js";import"./CollapsePanel.d756b861.js";import"./index.9b3c2ba8.js";import"./index.f6c308cc.js";import"./index.f7915957.js";import"./index.1ebdd57a.js";import"./index.7fdb6bd8.js";import"./index.693f4596.js";import"./index.5a37ef67.js";import"./index.19e4a065.js";import"./gateway.e1457457.js";import"./activeRecord.ebcbfc07.js";import"./pubsub.6e9aa6f2.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]="60e18558-2540-45b1-911b-a80e8bccf043",t._sentryDebugIdIdentifier="sentry-dbid-60e18558-2540-45b1-911b-a80e8bccf043")}catch{}})();const ae=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:m,result:l,refetch:p}=C(()=>n.list(e)),c=async o=>{const r=await n.create(e,o.name);a.push({name:"tableEditor",params:{tableId:r.id,projectId:e}})},d=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:d.value,fields:b,"create-button-text":"Create Table",onCreate:c},null,8,["loading","table"]))}});export{ae as default};
//# sourceMappingURL=Tables.02048181.js.map
