import{d as f,ez as y,eA as g,J as _,b as I,c as w,u as C}from"./outputWidgets.ec044eb8.js";import{e as T,q as h}from"./icons.a554ebda.js";import{a as k}from"./asyncComputed.70e28ece.js";import"./router.8cea9830.js";import"./index.ca493aff.js";import{T as s}from"./tables.3a786a7c.js";import{C as x}from"./CrudView.a07f1600.js";import"./Title.85fa9137.js";import"./index.6e43b5b9.js";import"./gateway.8ffe4c25.js";import"./activeRecord.eb528dd4.js";import"./pubsub.33b79e26.js";import"./index.cdce8068.js";import"./Form.316ac787.js";import"./url.a1da359b.js";import"./index.67245513.js";import"./index.d97f12e1.js";import"./index.cd569242.js";import"./index.185a1704.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="52485b22-daaa-4095-838a-02f77a3e122e",t._sentryDebugIdIdentifier="sentry-dbid-52485b22-daaa-4095-838a-02f77a3e122e")}catch{}})();const P=f({__name:"Tables",setup(t){const a=y(),e=g().params.projectId,{loading:l,result:d,refetch:m}=k(()=>s.list(e)),c=async o=>{const r=await s.create(e,o.name);a.push({name:"tableEditor",params:{tableId:r.id,projectId:e}})},p=_(()=>{var o,r;return{columns:[{name:"Table Name"},{name:"Actions",align:"right"}],rows:(r=(o=d.value)==null?void 0:o.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"tableEditor",params:{tableId:n.id,projectId:e}}},{text:"Actions",actions:[{icon:T,label:"Edit Table",onClick({key:b}){a.push({name:"tableEditor",params:{tableId:b,projectId:e}})}},{icon:h,label:"Delete",dangerous:!0,async onClick(){await n.delete(e,n.id),m()}}]}]})))!=null?r:[]}}),u=[{key:"name",label:"Table name",type:"text"}];return(o,r)=>(I(),w(x,{"entity-name":"table",loading:C(l),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:c},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Tables.063c517d.js.map
