import{d as f,ex as y,ey as _,F as g,b as I,u as T,bu as w}from"./registerWidgets.6f5be576.js";import{f as C,q as h}from"./icons.b2622455.js";import{a as k}from"./asyncComputed.ea0bb8a8.js";import{C as x}from"./CrudView.81000b9b.js";import"./gateway.1c0effff.js";import"./index.1c2771c5.js";import{T as n}from"./tables.407696de.js";import"./DropdownMenu.ecdd2e52.js";import"./Modal.dd94f88f.js";import"./LoadingIndicator.2446cb23.js";import"./lottie.df73e4a1.js";import"./passwordlessManager.1e2193ad.js";import"./pubsub.1dc45978.js";import"./storage.d8b26e7f.js";import"./activeRecord.eb203c6f.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6597ead1-55ee-4c74-b04a-f988852de8f4",e._sentryDebugIdIdentifier="sentry-dbid-6597ead1-55ee-4c74-b04a-f988852de8f4")}catch{}})();const J=f({__name:"Tables",setup(e){const t=y(),a=_().params.projectId,{loading:i,result:d,refetch:c}=k(()=>n.list(a)),m=async o=>{const s=await n.create(a,o.name);t.push({name:"tableEditor",params:{tableId:s.id,projectId:a}})},p=g(()=>{var o,s;return{columns:[{name:"Table Name"},{name:"Table Actions"}],rows:(s=(o=d.value)==null?void 0:o.map(r=>({key:r.id,cells:[{text:r.name,classes:["title","centered"]},{text:"Actions",classes:["centered"],actions:[{icon:C,label:"Edit Table",onClick({key:b}){t.push({name:"tableEditor",params:{tableId:b,projectId:a}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await r.delete(a,r.id),c()}}]}]})))!=null?s:[]}}),u=[{key:"name",label:"Table name",type:"text"}];return(o,s)=>(I(),T(x,{"entity-name":"table",loading:w(i),title:"Database Tables",description:"Create and manage your database tables here.","empty-title":"No tables here yet",table:p.value,fields:u,"create-button-text":"Create Table",onCreate:m},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Tables.f9125831.js.map
