import{d as y,ez as g,eA as C,G as T,b as _,c as k,u as I}from"./outputWidgets.723dbd35.js";import{e as w,g as h}from"./icons.d199659e.js";import{a as x}from"./asyncComputed.6087fd05.js";import"./router.c09623bf.js";import{T as s,n as i}from"./tables.9f501b84.js";import"./index.f80aedcf.js";import{C as D}from"./CrudView.ca2cf6ee.js";import"./Form.71a7af16.js";import"./index.b41dfd0a.js";import"./record.c3c42720.js";import"./pubsub.97441533.js";import"./gateway.ed2ccaa3.js";import"./index.d0473694.js";import"./Title.ad9727d9.js";import"./url.c8598ea1.js";import"./index.4913d787.js";import"./index.f91ebf4c.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a52d3d49-e63f-4a4c-be74-7a352a22a7d8",t._sentryDebugIdIdentifier="sentry-dbid-a52d3d49-e63f-4a4c-be74-7a352a22a7d8")}catch{}})();const P=y({__name:"Tables",setup(t){const o=g(),a=C().params.projectId,{loading:d,result:m,refetch:c}=x(()=>s.list(a)),p=async e=>{const r=await s.create(a,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:a}})},u=T(()=>{var e,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(e=m.value)==null?void 0:e.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:a}}},{text:"Actions",actions:[{icon:w,label:"Edit Table",onClick({key:f}){o.push({name:"tableEditor",params:{tableId:f,projectId:a}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(a,n.id),c()}}]}]})))!=null?r:[]}}),b=[{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(d),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:u.value,fields:b,"create-button-text":"Create Table",onCreate:p},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Tables.3725d9c7.js.map
