import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as k}from"./registerWidgets.d207d3d8.js";import{e as w,o as h}from"./icons.4cf3c6e7.js";import{a as x}from"./asyncComputed.9245c077.js";import"./gateway.b835e205.js";import"./index.ec4e5819.js";import{T as s}from"./tables.6c6b2720.js";import{_ as C}from"./CrudView.vue_vue_type_script_setup_true_lang.892f2f1d.js";import"./passwordlessManager.66faf323.js";import"./pubsub.a025efb1.js";import"./storage.955f9c37.js";import"./activeRecord.3ac0bec0.js";import"./Modal.c3922cf6.js";import"./Title.db9c20f2.js";import"./transButton.c5e342ac.js";import"./index.ed3f099d.js";import"./Text.df3bd99f.js";import"./index.a3599972.js";import"./index.ce572c42.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="44548547-6d0d-4097-9815-2ce7e2c8145e",t._sentryDebugIdIdentifier="sentry-dbid-44548547-6d0d-4097-9815-2ce7e2c8145e")}catch{}})();const O=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:l,result:d,refetch:m}=x(()=>s.list(e)),c=async o=>{const r=await s.create(e,o.name);a.push({name:"tableEditor",params:{tableId:r.id,projectId:e}})},p=g(()=>{var o,r;return{columns:[{name:"Table Name"},{name:"Table Actions"}],rows:(r=(o=d.value)==null?void 0:o.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:e}}},{text:"Actions",actions:[{icon:w,label:"Edit Table",onClick({key:b}){a.push({name:"tableEditor",params:{tableId:b,projectId:e}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(e,n.id),m()}}]}]})))!=null?r:[]}}),u=[{key:"name",label:"Table name",type:"text"}];return(o,r)=>(I(),T(C,{"entity-name":"table",loading:k(l),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:p.value,fields:u,"create-button-text":"Create Table",onCreate:c},null,8,["loading","table"]))}});export{O as default};
//# sourceMappingURL=Tables.c5d55e8b.js.map
