import{d as y,ey as g,ez as C,F as T,b as _,c as k,u as I}from"./outputWidgets.34c6efe4.js";import{u as w,o as h}from"./icons.54b54949.js";import{a as x}from"./asyncComputed.c2993a02.js";import"./router.5e015991.js";import"./jwt-decode.esm.74bd4619.js";import{T as s}from"./tables.3acfc9c9.js";import"./index.56db27ff.js";import{C as D}from"./CrudView.4c8279a4.js";import{n as i}from"./string.6701a811.js";import"./FormItem.87557e8f.js";import"./hasIn.7f8c0878.js";import"./storage.f2a353cd.js";import"./index.b5389b8f.js";import"./record.24a52f99.js";import"./pubsub.7392fe5a.js";import"./index.cf4c23b9.js";import"./Title.6b365a17.js";import"./Text.4d22598c.js";import"./Form.3d80c841.js";import"./Modal.20b7a2a4.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d3e3a57a.js";import"./url.e9fe64cc.js";import"./index.95a2f4e1.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]="15fffdf2-dd45-4cfc-a752-b1cec7b20b19",a._sentryDebugIdIdentifier="sentry-dbid-15fffdf2-dd45-4cfc-a752-b1cec7b20b19")}catch{}})();const Z=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:"",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:u}){o.push({name:"tableEditor",params:{tableId:u,projectId:t}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(t,n.id),c()}}]}]})))!=null?r:[]}}),f=[{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:f,"create-button-text":"Create Table",onCreate:p},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Tables.4cbf1b61.js.map
