import{d as y,ey as g,ez as C,F as T,b as _,c as k,u as I}from"./outputWidgets.8246053b.js";import{u as w,o as h}from"./icons.1afdbafb.js";import{a as x}from"./asyncComputed.e925ebe9.js";import"./router.ee3d3d59.js";import"./jwt-decode.esm.74bd4619.js";import{T as s}from"./tables.2ea731e7.js";import"./index.ab651559.js";import{C as D}from"./CrudView.f24fc2d1.js";import{n as i}from"./string.50a6b697.js";import"./FormItem.377ec60f.js";import"./hasIn.afa75b8c.js";import"./storage.195d9a4f.js";import"./index.2b26c55a.js";import"./record.112817cd.js";import"./pubsub.cf08d0ee.js";import"./index.cf4c23b9.js";import"./Title.f9200d53.js";import"./Text.2015d383.js";import"./Form.876e6977.js";import"./Modal.ab74e114.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.ae17871c.js";import"./url.9664ee35.js";import"./index.47f3a57d.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]="becaf42b-eabb-4332-8d92-b65fbf9e6239",a._sentryDebugIdIdentifier="sentry-dbid-becaf42b-eabb-4332-8d92-b65fbf9e6239")}catch{}})();const Z=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:d,refetch:p}=x(()=>s.list(t)),b=async e=>{const r=await s.create(t,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:t}})},c=T(()=>{var e,r;return{columns:[{name:"Table Name"},{name:"",align:"right"}],rows:(r=(e=d.value)==null?void 0:e.map(n=>({key:n.id,cells:[{type:"link",text:n.name,to:{name:"tableEditor",params:{tableId:n.id,projectId:t}}},{type:"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:c.value,fields:u,"create-button-text":"Create Table",onCreate:b},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Tables.d59eacc3.js.map
