import{d as y,ey as g,ez as C,F as T,b as _,c as k,u as I}from"./outputWidgets.b703ca45.js";import{u as w,o as h}from"./icons.5202cd65.js";import{a as x}from"./asyncComputed.557fdbc3.js";import"./router.c2e4e322.js";import"./jwt-decode.esm.74bd4619.js";import{T as s}from"./tables.55f992be.js";import"./index.58a6f7ec.js";import{C as D}from"./CrudView.93e41830.js";import{n as i}from"./string.b7af0a8a.js";import"./FormItem.39e0b98f.js";import"./hasIn.66135dec.js";import"./storage.4f0beb94.js";import"./index.cd3799ce.js";import"./record.6a34e5b4.js";import"./pubsub.781c61cb.js";import"./index.cf4c23b9.js";import"./Title.c76d824d.js";import"./Text.4646803d.js";import"./Form.44bc3190.js";import"./Modal.c03e4b0a.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.69b7b47b.js";import"./url.7a748c18.js";import"./index.5255b475.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]="51a4b432-b727-4a49-924f-154658118f99",a._sentryDebugIdIdentifier="sentry-dbid-51a4b432-b727-4a49-924f-154658118f99")}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:f}){o.push({name:"tableEditor",params:{tableId:f,projectId:t}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(t,n.id),d()}}]}]})))!=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:c},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Tables.2025443f.js.map
