import{d as f,ez as y,eA as _,J as g,b as I,c as T,u as h}from"./outputWidgets.b13a87c2.js";import{e as k,p as w}from"./icons.76c1fe8b.js";import{a as C}from"./asyncComputed.02afd50e.js";import"./console.d76c010c.js";import"./index.b8915c7f.js";import{T as n}from"./tables.2404a049.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.cf244ae9.js";import"./index.98e61e8e.js";import"./Form.e21e0d73.js";import"./Title.6f86755a.js";import"./index.3d7f8177.js";import"./index.55a2786b.js";import"./index.c4d59e95.js";import"./dayjs.2e90d17d.js";import"./index.fbf04eaa.js";import"./index.7011a200.js";import"./TabPane.3cb0210e.js";import"./index.0345671f.js";import"./index.24360d49.js";import"./index.c32ce6af.js";import"./index.73746068.js";import"./index.7dcc157a.js";import"./index.0b99f8ef.js";import"./index.1b5bc05c.js";import"./index.957937c4.js";import"./gateway.f581ef9f.js";import"./activeRecord.f5a2d19d.js";import"./pubsub.dab46576.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]="e58bfadc-ad04-44dc-8aa4-81215008f3a0",t._sentryDebugIdIdentifier="sentry-dbid-e58bfadc-ad04-44dc-8aa4-81215008f3a0")}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.7c62f790.js.map
