import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.470cd725.js";import{u as w,o as h}from"./icons.732210f6.js";import{a as x}from"./asyncComputed.72d91ef9.js";import"./authorManager.176ccd94.js";import{T as s}from"./tables.1e5a0e1a.js";import"./index.d44cde0e.js";import{C as D}from"./CrudView.e08250db.js";import{n as i}from"./string.ad46db6a.js";import"./record.19f593f6.js";import"./pubsub.bb7b27fb.js";import"./gateway.6d700df7.js";import"./index.cf4c23b9.js";import"./Title.edbac04b.js";import"./Text.fbb768c7.js";import"./FormItem.bd89e955.js";import"./hasIn.6bd3aa8a.js";import"./Form.bf13abb6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.702cb95e.js";import"./router.bb51d819.js";import"./index.672f7932.js";import"./url.28fafd73.js";import"./index.e48b3db7.js";import"./index.2d4e9800.js";import"./index.52ab7ae6.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]="f0db572e-b84a-41d6-ad31-d4d66b052c02",a._sentryDebugIdIdentifier="sentry-dbid-f0db572e-b84a-41d6-ad31-d4d66b052c02")}catch{}})();const $=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:d,refetch:p}=x(()=>s.list(t)),c=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=d.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),p()}}]}]})))!=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:c},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Tables.682eef49.js.map
