import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.ec1b7422.js";import{u as w,o as h}from"./icons.1f6f4554.js";import{a as x}from"./asyncComputed.57876dc8.js";import"./authorManager.f240882c.js";import{T as s}from"./tables.450040fb.js";import"./index.c3f6367a.js";import{C as D}from"./CrudView.ccacbeb0.js";import{n as i}from"./string.eacaf60e.js";import"./record.a3f4df6a.js";import"./pubsub.e392a757.js";import"./gateway.7a02c698.js";import"./index.cf4c23b9.js";import"./Title.4910381d.js";import"./Text.aae02753.js";import"./FormItem.674c81e4.js";import"./hasIn.4d766825.js";import"./Form.7cf53a7d.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7b07d981.js";import"./router.901d31dd.js";import"./index.0c8affc8.js";import"./url.7d2ac932.js";import"./index.058f9bc6.js";import"./index.310cb573.js";import"./index.4fad3763.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]="1f02ac67-b6aa-4013-a36d-11f7b5cc4658",a._sentryDebugIdIdentifier="sentry-dbid-1f02ac67-b6aa-4013-a36d-11f7b5cc4658")}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.77e96b69.js.map
