import{d as y,ey as g,ez as C,F as T,b as _,c as k,u as I}from"./outputWidgets.517466a4.js";import{u as w,o as h}from"./icons.18ac3d6d.js";import{a as x}from"./asyncComputed.4cc49353.js";import"./router.7372192a.js";import"./jwt-decode.esm.74bd4619.js";import{T as s}from"./tables.8df14023.js";import"./index.93c4bd99.js";import{C as D}from"./CrudView.3319d010.js";import{n as i}from"./string.4a866eab.js";import"./FormItem.ebe02103.js";import"./hasIn.41d385a0.js";import"./storage.a7faa4ce.js";import"./index.c09b1845.js";import"./record.00f55d8c.js";import"./pubsub.1c68a664.js";import"./index.cf4c23b9.js";import"./Title.50fff1e9.js";import"./Text.b4fa08c4.js";import"./Form.dedf0123.js";import"./Modal.c37f1dd1.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.541da426.js";import"./url.f9726388.js";import"./index.1de61334.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]="8faf52f4-022b-4f8b-8727-1f2b5f99a69a",a._sentryDebugIdIdentifier="sentry-dbid-8faf52f4-022b-4f8b-8727-1f2b5f99a69a")}catch{}})();const Z=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:p,refetch:d}=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:"",align:"right"}],rows:(r=(e=p.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),d()}}]}]})))!=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:c},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Tables.8238e3c1.js.map
