import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.c7c3593b.js";import{q as w,n as h}from"./icons.e912a40c.js";import{a as x}from"./asyncComputed.87d89e82.js";import"./authorManager.33208873.js";import{T as s}from"./tables.d08c9bd9.js";import"./index.640c3418.js";import{C as D}from"./CrudView.b146ef3d.js";import{n as i}from"./string.6b771772.js";import"./record.b6e0d210.js";import"./pubsub.a1271b13.js";import"./gateway.94d6767e.js";import"./index.cf4c23b9.js";import"./Title.47031f69.js";import"./Text.1c53905c.js";import"./FormItem.9941e947.js";import"./hasIn.f4bb54d3.js";import"./Form.5652ed9b.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.252f0a18.js";import"./router.051bd37d.js";import"./index.50d90398.js";import"./url.03aeeb48.js";import"./index.6a297772.js";import"./index.26b290e3.js";import"./index.03af204f.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="c4249d10-1b7b-4ca3-a8cb-3173d51ea549",a._sentryDebugIdIdentifier="sentry-dbid-c4249d10-1b7b-4ca3-a8cb-3173d51ea549")}catch{}})();const $=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:c,refetch:d}=x(()=>s.list(t)),p=async e=>{const r=await s.create(t,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:t}})},b=T(()=>{var e,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(e=c.value)==null?void 0:e.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:t}}},{text:"Actions",actions:[{icon:w,label:"Edit Table",onClick({key:f}){o.push({name:"tableEditor",params:{tableId:f,projectId:t}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(t,n.id),d()}}]}]})))!=null?r:[]}}),u=[{key:"name",label:"Table name",type:"text",format:e=>i(e,!0),blur:e=>i(e,!1)}];return(e,r)=>(_(),k(D,{"entity-name":"table",loading:I(m),"docs-path":"tables/overview",title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:b.value,fields:u,"create-button-text":"Create Table",onCreate:p},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Tables.aeac638b.js.map
