import{d as f,ez as y,eA as _,J as g,b as I,c as T,u as h}from"./outputWidgets.b9aa154a.js";import{e as k,p as w}from"./icons.4ed83c58.js";import{a as C}from"./asyncComputed.9bda3979.js";import"./console.ee73e2aa.js";import"./index.4d631048.js";import{T as n}from"./tables.2ca0233f.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.8866a12f.js";import"./index.ade1bec6.js";import"./Form.55f226f4.js";import"./Title.6cd833fd.js";import"./index.74d4e484.js";import"./index.6b140cad.js";import"./index.29aa7167.js";import"./dayjs.d2a09bae.js";import"./index.ea68e603.js";import"./index.bb85a084.js";import"./TabPane.3d00468a.js";import"./index.ab1855db.js";import"./index.14f3ef13.js";import"./index.eb23b22d.js";import"./index.45ef6041.js";import"./index.45ac8fb9.js";import"./index.004b987c.js";import"./index.23063916.js";import"./index.55488473.js";import"./gateway.5aa82c5f.js";import"./activeRecord.8939db5d.js";import"./pubsub.967f482a.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]="12edcb83-dac9-4395-a277-0385ce1d313f",t._sentryDebugIdIdentifier="sentry-dbid-12edcb83-dac9-4395-a277-0385ce1d313f")}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.d2080f55.js.map
