import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.32262ea4.js";import{v as w,g as h}from"./icons.f6f8ddd9.js";import{a as x}from"./asyncComputed.2515c9c2.js";import"./authorManager.bf87d9ac.js";import{T as i}from"./tables.aa3958fd.js";import"./index.2dfe4d35.js";import{C as v}from"./CrudView.3a879739.js";import{n as s}from"./string.1d0a5834.js";import"./record.b25fae92.js";import"./pubsub.688bf9b2.js";import"./gateway.c70bbf22.js";import"./index.cf4c23b9.js";import"./Text.5738d3bb.js";import"./Title.4f1fbb5b.js";import"./FormItem.dc863e60.js";import"./hasIn.4e5c4024.js";import"./Form.0ac7561e.js";import"./Modal.1c897574.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.db135e16.js";import"./router.24325fd4.js";import"./index.1d7a7a89.js";import"./url.bc186fa2.js";import"./index.e1a424df.js";import"./index.62cf3b9c.js";import"./index.0278a234.js";import"./index.df3792d3.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]="867e742d-2141-4b18-9439-b9d5aca9123d",a._sentryDebugIdIdentifier="sentry-dbid-867e742d-2141-4b18-9439-b9d5aca9123d")}catch{}})();const te=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:d,refetch:p}=x(()=>i.list(t)),c=async e=>{const r=await i.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=>s(e,!0),blur:e=>s(e,!1)}];return(e,r)=>(_(),k(v,{"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{te as default};
//# sourceMappingURL=Tables.efd4da3a.js.map
