import{d as y,eA as g,eB as C,G as T,b as _,c as k,u as I}from"./outputWidgets.84fd06fb.js";import{e as w,g as h}from"./icons.3869c437.js";import{a as x}from"./asyncComputed.da204aa5.js";import"./router.a59cab44.js";import{T as s,n as i}from"./tables.4866706f.js";import"./index.0bfee40a.js";import{C as D}from"./CrudView.500d5f8a.js";import"./Base.67ffff63.js";import"./transButton.64565967.js";import"./Text.9dbcc31d.js";import"./Title.564982df.js";import"./index.a606b6d8.js";import"./record.f0008bb4.js";import"./pubsub.8883f68b.js";import"./gateway.82cdc40d.js";import"./url.53969469.js";import"./index.6b6af4b4.js";import"./index.02fdeca3.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]="3714bd97-1fd5-4fd0-a0c0-e94c4280926d",a._sentryDebugIdIdentifier="sentry-dbid-3714bd97-1fd5-4fd0-a0c0-e94c4280926d")}catch{}})();const Q=y({__name:"Tables",setup(a){const o=g(),t=C().params.projectId,{loading:d,result:m,refetch:c}=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}})},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: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),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{Q as default};
//# sourceMappingURL=Tables.4c47a018.js.map
