import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.396f5ce1.js";import{v as w,g as h}from"./icons.37b6f90f.js";import{a as x}from"./asyncComputed.95737324.js";import"./router.898a5ca4.js";import{T as i}from"./tables.35031b3d.js";import"./index.d80eeb49.js";import{C as D}from"./CrudView.ece8081d.js";import{n as s}from"./string.db77e9d6.js";import"./FormItem.a8de7296.js";import"./hasIn.63a13365.js";import"./index.f3919413.js";import"./record.1aff3d29.js";import"./pubsub.06faa612.js";import"./gateway.a0e7cb55.js";import"./index.cf4c23b9.js";import"./Text.4e180dc2.js";import"./Base.ee1dde08.js";import"./Form.716e7fa5.js";import"./Modal.c02a2840.js";import"./url.4e42e1d0.js";import"./index.645b3e28.js";import"./index.a44632c5.js";import"./Title.819eb0fe.js";import"./index.f0384574.js";import"./index.a23873b5.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="01b3686f-5ab8-455f-989a-a27e47fa85f0",a._sentryDebugIdIdentifier="sentry-dbid-01b3686f-5ab8-455f-989a-a27e47fa85f0")}catch{}})();const ee=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:p,refetch:d}=x(()=>i.list(t)),c=async e=>{const r=await i.create(t,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:t}})},b=T(()=>{var e,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(e=p.value)==null?void 0:e.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:t}}},{text:"Actions",actions:[{icon:w,label:"Edit Table",onClick({key:f}){o.push({name:"tableEditor",params:{tableId:f,projectId:t}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(t,n.id),d()}}]}]})))!=null?r:[]}}),u=[{key:"name",label:"Table name",type:"text",format:e=>s(e,!0),blur:e=>s(e,!1)}];return(e,r)=>(_(),k(D,{"entity-name":"table",loading:I(m),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:b.value,fields:u,"create-button-text":"Create Table",onCreate:c},null,8,["loading","table"]))}});export{ee as default};
//# sourceMappingURL=Tables.287a7994.js.map
