import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as k}from"./registerWidgets.1e9167ab.js";import{e as w,o as h}from"./icons.41af03d8.js";import{a as x}from"./asyncComputed.8a644895.js";import"./gateway.6096f5a8.js";import"./index.11f5d4e4.js";import{T as s}from"./tables.095a6fa4.js";import{_ as C}from"./CrudView.vue_vue_type_script_setup_true_lang.e0bf9fc2.js";import"./passwordlessManager.b7f590c1.js";import"./pubsub.09eafe35.js";import"./storage.84fcb572.js";import"./activeRecord.60b6bd01.js";import"./Modal.b646cd22.js";import"./Title.d1f45d59.js";import"./transButton.755e702e.js";import"./index.9165a659.js";import"./Text.c8d7b4c0.js";import"./index.32c7f8ee.js";import"./index.d74062f4.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]="3519ebd3-31e4-4ded-b252-88f47fffd782",t._sentryDebugIdIdentifier="sentry-dbid-3519ebd3-31e4-4ded-b252-88f47fffd782")}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:u}){a.push({name:"tableEditor",params:{tableId:u,projectId:e}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(e,n.id),m()}}]}]})))!=null?r:[]}}),b=[{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:b,"create-button-text":"Create Table",onCreate:c},null,8,["loading","table"]))}});export{O as default};
//# sourceMappingURL=Tables.3fe8f8cc.js.map
