import{d as y,ez as g,eA as C,J as T,b as _,c as k,u as I}from"./outputWidgets.f120b477.js";import{e as w,q as h}from"./icons.c367c256.js";import{a as x}from"./asyncComputed.5ccd4614.js";import"./router.e3ecb487.js";import"./index.81859a03.js";import{T as s}from"./tables.bf4afdea.js";import{C as D}from"./CrudView.87b341af.js";import{n as i}from"./string.c4e71dd1.js";import"./Title.3dc4e32d.js";import"./index.5818bfb2.js";import"./gateway.a36b7b3a.js";import"./activeRecord.d87d7ef2.js";import"./pubsub.4681462f.js";import"./index.3ab4f365.js";import"./Form.ec892c10.js";import"./url.8af07297.js";import"./index.b96fbbd8.js";import"./index.3801d49d.js";import"./index.de46e6db.js";import"./index.54e8798a.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]="d32fc224-baae-4a2d-8459-6b1f640c7c22",a._sentryDebugIdIdentifier="sentry-dbid-d32fc224-baae-4a2d-8459-6b1f640c7c22")}catch{}})();const W=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:m,result:c,refetch:d}=x(()=>s.list(t)),p=async e=>{const r=await s.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=c.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=>i(e,!0),blur:e=>i(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:p},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Tables.1e1a1e62.js.map
