import{d as f,ez as y,eA as _,J as g,b as I,c as T,u as h}from"./outputWidgets.17392370.js";import{e as k,q as w}from"./icons.baa5f07a.js";import{a as C}from"./asyncComputed.76849272.js";import"./console.9b12928f.js";import"./index.c5e8e3a4.js";import{T as n}from"./tables.079f509e.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.c4e89a02.js";import"./index.7c30bb7a.js";import"./Form.e398e550.js";import"./Title.bc3ff086.js";import"./CollapsePanel.853dbd0d.js";import"./index.2e2d3a0a.js";import"./index.ba0ff767.js";import"./index.84380f11.js";import"./dayjs.05e1ae11.js";import"./index.56ff0f0c.js";import"./index.bd94f307.js";import"./TabPane.25e9ccd4.js";import"./index.8aa7fba2.js";import"./index.50017ce4.js";import"./index.fffd13c2.js";import"./index.d2f4083e.js";import"./index.1fd97730.js";import"./index.3e3b85af.js";import"./index.18880d1b.js";import"./index.8c91651f.js";import"./index.8d8985c7.js";import"./gateway.ee06b706.js";import"./activeRecord.84b679f6.js";import"./pubsub.fc739490.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]="599a3989-10f3-46e5-a450-30ce0fa986da",t._sentryDebugIdIdentifier="sentry-dbid-599a3989-10f3-46e5-a450-30ce0fa986da")}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:b}){a.push({name:"tableEditor",params:{tableId:b,projectId:e}})}},{icon:w,label:"Delete",dangerous:!0,async onClick(){await i.delete(e,i.id),p()}}]}]})))!=null?r:[]}}),u=[{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:u,"create-button-text":"Create Table",onCreate:d},null,8,["loading","table"]))}});export{ae as default};
//# sourceMappingURL=Tables.558cc686.js.map
