import{d as f,ex as y,ey as _,H as g,b as I,c as T,u as h}from"./registerWidgets.ca9618c6.js";import{e as k,p as w}from"./icons.71da0300.js";import{a as x}from"./asyncComputed.f26ab310.js";import"./gateway.f5df01e9.js";import"./index.eb434d5a.js";import{T as s}from"./tables.0c68772c.js";import{_ as C}from"./CrudView.vue_vue_type_script_setup_true_lang.0535df40.js";import"./passwordlessManager.91e53713.js";import"./pubsub.197ceb4e.js";import"./storage.a502fdce.js";import"./activeRecord.fa727ba5.js";import"./index.6cc8ffe0.js";import"./Title.f740cc19.js";import"./Form.fac64e0c.js";import"./index.11818713.js";import"./index.b013a4c0.js";import"./index.c0bd1022.js";import"./index.7c566b28.js";import"./index.6a4df70c.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]="3c51d964-7767-469f-a60c-8705c8f5a884",t._sentryDebugIdIdentifier="sentry-dbid-3c51d964-7767-469f-a60c-8705c8f5a884")}catch{}})();const P=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:l,result:c,refetch:m}=x(()=>s.list(e)),d=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:"Actions",align:"right"}],rows:(r=(o=c.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:k,label:"Edit Table",onClick({key:b}){a.push({name:"tableEditor",params:{tableId:b,projectId:e}})}},{icon:w,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:h(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:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Tables.11d69f54.js.map
