import{d as f,ez as y,eA as _,J as g,b as I,c as T,u as h}from"./outputWidgets.b43a489b.js";import{e as k,q as w}from"./icons.de9af46a.js";import{a as C}from"./asyncComputed.a42e75bb.js";import"./console.bbd86620.js";import"./index.d989c562.js";import{T as n}from"./tables.4ed055d4.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.85d5e2a7.js";import"./index.42b92ee8.js";import"./Form.1797df89.js";import"./Title.47040052.js";import"./CollapsePanel.3e5384f9.js";import"./index.523f4a12.js";import"./index.65dea612.js";import"./index.9c88be1a.js";import"./dayjs.caeff4fe.js";import"./index.0279b5ff.js";import"./index.956893d2.js";import"./TabPane.b49c19a0.js";import"./index.0887e3a5.js";import"./index.a775b9cf.js";import"./index.e641ddba.js";import"./index.479accfd.js";import"./index.9367a16c.js";import"./index.8df4e710.js";import"./index.2fc0be8f.js";import"./index.8a60ee51.js";import"./index.85f24c29.js";import"./gateway.38461683.js";import"./activeRecord.2bc5cc59.js";import"./pubsub.6fd47a9d.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]="c71ab1fd-a548-498b-9256-3121028968b4",t._sentryDebugIdIdentifier="sentry-dbid-c71ab1fd-a548-498b-9256-3121028968b4")}catch{}})();const ae=f({__name:"Tables",setup(t){const a=y(),e=_().params.projectId,{loading:m,result:l,refetch:p}=C(()=>n.list(e)),d=async o=>{const r=await n.create(e,o.name);a.push({name:"tableEditor",params:{tableId:r.id,projectId:e}})},c=g(()=>{var o,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(o=l.value)==null?void 0:o.map(i=>({key:i.id,cells:[{text:i.name,link:{name:"tableEditor",params:{tableId:i.id,projectId:e}}},{text:"Actions",actions:[{icon:k,label:"Edit Table",onClick({key:u}){a.push({name:"tableEditor",params:{tableId:u,projectId:e}})}},{icon:w,label:"Delete",dangerous:!0,async onClick(){await i.delete(e,i.id),p()}}]}]})))!=null?r:[]}}),b=[{key:"name",label:"Table name",type:"text"}];return(o,r)=>(I(),T(x,{"entity-name":"table",loading:h(m),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:c.value,fields:b,"create-button-text":"Create Table",onCreate:d},null,8,["loading","table"]))}});export{ae as default};
//# sourceMappingURL=Tables.b435e5dc.js.map
