import{d as f,ez as y,eA as g,J as _,b as I,c as w,u as C}from"./outputWidgets.cf5b7366.js";import{e as T,q as h}from"./icons.c510a141.js";import{a as k}from"./asyncComputed.2caa7fe6.js";import"./router.565b4739.js";import"./index.2fa55c7c.js";import{T as s}from"./tables.62e21b45.js";import{C as x}from"./CrudView.ca1846b4.js";import"./Title.adce1298.js";import"./index.3d2fbf9e.js";import"./gateway.409ff644.js";import"./activeRecord.f30e02c2.js";import"./pubsub.664a70af.js";import"./index.7622dd54.js";import"./Form.c8affe88.js";import"./url.fb40e08c.js";import"./index.47f17eed.js";import"./index.aee8b5d5.js";import"./index.9583d9e9.js";import"./index.10cdfb2c.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]="f3e14700-08a5-4bfd-a0cc-61f1f68f6449",t._sentryDebugIdIdentifier="sentry-dbid-f3e14700-08a5-4bfd-a0cc-61f1f68f6449")}catch{}})();const P=f({__name:"Tables",setup(t){const a=y(),e=g().params.projectId,{loading:l,result:d,refetch:m}=k(()=>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=_(()=>{var o,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],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:T,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(),w(x,{"entity-name":"table",loading:C(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{P as default};
//# sourceMappingURL=Tables.ff41096d.js.map
