import{C as g}from"./CrudView.d781e8fd.js";import{a as _}from"./ant-design.2f4e4d05.js";import{a as k}from"./asyncComputed.5f4a7018.js";import{n as i}from"./string.a9f2e2e2.js";import{G as C}from"./PhPencil.vue.34413cfd.js";import{d as T,eH as w,ef as h,f as I,o as x,Y as E,b as l,u as D,aS as N,er as S}from"./index.a1506152.js";import"./gateway.36e126ca.js";import{T as m}from"./tables.ca746641.js";import{_ as v}from"./TablesTabs.vue_vue_type_script_setup_true_lang.afabde44.js";import"./router.2d44d6fc.js";import"./Badge.07d26512.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.30c09690.js";import"./BookOutlined.989c2e9e.js";import"./url.e9cfa1d3.js";import"./PhDotsThreeVertical.vue.0cdf9efb.js";import"./index.a25bcd68.js";import"./index.4f812115.js";import"./popupNotifcation.7c2101f3.js";import"./record.d6bf7292.js";import"./TabPane.15ef770b.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]="b7ca6c15-2525-4161-b04f-d024c55e4a4a",a._sentryDebugIdIdentifier="sentry-dbid-b7ca6c15-2525-4161-b04f-d024c55e4a4a")}catch{}})();const Z=T({__name:"Tables",setup(a){const o=w(),t=h().params.projectId,{loading:d,result:p,refetch:u}=k(()=>m.list(t)),f=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),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(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:f},null,8,["loading","table"])],64))}});export{Z as default};
//# sourceMappingURL=Tables.915977c2.js.map
