import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.5d603989.js";import{o as w,l as h}from"./icons.bd111c16.js";import{a as x}from"./asyncComputed.58ba4f93.js";import"./authorManager.c2511e61.js";import{T as s}from"./tables.19b90d14.js";import"./index.31469fdb.js";import{C as D}from"./CrudView.d4ee2ca6.js";import{n as i}from"./string.3ee0245c.js";import"./record.d917866d.js";import"./pubsub.6c84e9b3.js";import"./gateway.4795e7dc.js";import"./index.cf4c23b9.js";import"./Title.ff9a3ba8.js";import"./Text.09cd31d9.js";import"./FormItem.908927d2.js";import"./hasIn.fd9b99bd.js";import"./Form.f9dc07de.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.94c2a2ef.js";import"./router.cff355e3.js";import"./index.7ab57155.js";import"./url.db1ec50a.js";import"./index.af1c082d.js";import"./index.55aa4166.js";import"./index.5d1709ee.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]="6ac5a3cb-b68a-45f0-a1bb-00569d5d899b",a._sentryDebugIdIdentifier="sentry-dbid-6ac5a3cb-b68a-45f0-a1bb-00569d5d899b")}catch{}})();const $=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:d,refetch:c}=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=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),c()}}]}]})))!=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.8666a32a.js.map
