import{C as g}from"./CrudView.dc8ec5ca.js";import{a as _}from"./ant-design.ad3f7270.js";import{a as k}from"./asyncComputed.3e41b686.js";import{n as i}from"./string.4c6457d7.js";import{G as C}from"./PhPencil.vue.2048d912.js";import{d as T,eo as w,ea as h,f as I,o as x,Y as E,b as l,u as D,aS as N,ep as S}from"./index.3d66ab3f.js";import"./gateway.c90c4cc0.js";import{T as m}from"./tables.00563f55.js";import{_ as v}from"./TablesTabs.vue_vue_type_script_setup_true_lang.f30ca4f6.js";import"./router.ea31524e.js";import"./Badge.51abc7fa.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.945c4045.js";import"./BookOutlined.e97635c4.js";import"./url.64c961af.js";import"./PhDotsThreeVertical.vue.1eba4335.js";import"./index.103fa591.js";import"./index.2a5e7e41.js";import"./popupNotifcation.f439583b.js";import"./record.20acbd16.js";import"./TabPane.6d18ecdb.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]="15cbd3d1-bb0b-437c-ad66-f55153838508",a._sentryDebugIdIdentifier="sentry-dbid-15cbd3d1-bb0b-437c-ad66-f55153838508")}catch{}})();const Z=T({__name:"Tables",setup(a){const o=w(),t=h().params.projectId,{loading:c,result:p,refetch:u}=k(()=>m.list(t)),b=async e=>{const r=await m.create(t,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:t}})},f=I(()=>{var e,r;return{columns:[{title:"Table Name"},{title:"",align:"right"}],rows:(r=(e=p.value)==null?void 0:e.map(n=>({key:n.id,cells:[{type:"link",text:n.name,to:{name:"tableEditor",params:{tableId:n.id,projectId:t}}},{type:"actions",actions:[{icon:C,label:"Edit Table",onClick({key:s}){o.push({name:"tableEditor",params:{tableId:s,projectId:t}})}},{icon:S,label:"Delete",dangerous:!0,async onClick(){!await _("Are you sure you want to delete this table and all its data?")||(await n.delete(t,n.id),u())}}]}]})))!=null?r:[]}}),y=[{key:"name",label:"Table name",type:"text",format:e=>i(e,!0),blur:e=>i(e,!1)}];return(e,r)=>(x(),E(N,null,[l(v),l(g,{"entity-name":"table",loading:D(c),"docs-path":"cloud/tables",title:"Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:f.value,fields:y,"create-button-text":"Create Table",create:b},null,8,["loading","table"])],64))}});export{Z as default};
//# sourceMappingURL=Tables.17df6e4b.js.map
