import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as k}from"./registerWidgets.faec4901.js";import{e as w,o as h}from"./icons.4b27c20b.js";import{a as x}from"./asyncComputed.04758d6d.js";import"./gateway.241cb512.js";import"./index.a999bbce.js";import{T as s}from"./tables.3db31bd7.js";import{_ as C}from"./CrudView.vue_vue_type_script_setup_true_lang.3dfdcdc3.js";import"./passwordlessManager.90d3a316.js";import"./pubsub.c32c984e.js";import"./storage.02df2e1a.js";import"./activeRecord.64153c3d.js";import"./Modal.c4a3eb37.js";import"./Title.38629c7e.js";import"./transButton.389d0ba4.js";import"./index.bd454869.js";import"./Text.8913855c.js";import"./index.353431e1.js";import"./index.da74220a.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]="c68aa449-28d5-4df0-8756-e7f4d2e18db3",t._sentryDebugIdIdentifier="sentry-dbid-c68aa449-28d5-4df0-8756-e7f4d2e18db3")}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.6c9927a7.js.map
