import{C as g}from"./CrudView.b0205a71.js";import{a as _}from"./ant-design.156ae155.js";import{a as k}from"./asyncComputed.dea6d978.js";import{n as i}from"./string.b6e197ca.js";import{G as C}from"./PhPencil.vue.945173fd.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.57388330.js";import"./gateway.e592f357.js";import{T as m}from"./tables.01dc6a89.js";import{_ as v}from"./TablesTabs.vue_vue_type_script_setup_true_lang.2b0808f9.js";import"./router.7e66296a.js";import"./Badge.b4017a04.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.834b9f8a.js";import"./BookOutlined.7b183253.js";import"./url.40a6ac51.js";import"./PhDotsThreeVertical.vue.b90e775f.js";import"./index.09157d5c.js";import"./index.1b2729a9.js";import"./popupNotifcation.cc3d27fb.js";import"./record.82dac5d0.js";import"./TabPane.84cd23d9.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]="efca78f9-ce12-4939-b8f5-4180cfe19bca",a._sentryDebugIdIdentifier="sentry-dbid-efca78f9-ce12-4939-b8f5-4180cfe19bca")}catch{}})();const Z=T({__name:"Tables",setup(a){const o=w(),t=h().params.projectId,{loading:d,result:p,refetch:f}=k(()=>m.list(t)),u=async e=>{const r=await m.create(t,e.name);o.push({name:"tableEditor",params:{tableId:r.id,projectId:t}})},b=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),f())}}]}]})))!=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(d),"docs-path":"cloud/tables",title:"Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:b.value,fields:y,"create-button-text":"Create Table",create:u},null,8,["loading","table"])],64))}});export{Z as default};
//# sourceMappingURL=Tables.dcbe9976.js.map
