import{d as _,ey as w,H as h,b as k,c as C,w as c,f as l,u as O}from"./outputWidgets.942e04a7.js";import{e as x,b as I}from"./icons.c37bd5be.js";import{a as v}from"./asyncComputed.581a6d32.js";import"./router.88ac172f.js";import{O as d}from"./organization.bbf9b4b1.js";import"./columns.b249ad7a.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.b3ffdc0e.js";import{C as A}from"./CrudView.ef33eac6.js";import{B}from"./BaseLayout.d874b5ce.js";import{a as N}from"./ant-design.683e844e.js";import"./Title.02f374d5.js";import"./index.6d3b437a.js";import"./gateway.c853ac2b.js";import"./activeRecord.c49c8827.js";import"./pubsub.c4874b0f.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.a0056785.js";import"./index.90e879e1.js";import"./index.e7605f26.js";import"./Form.fa989528.js";import"./url.c27b4b3f.js";import"./index.afbbab9c.js";import"./index.a1c695e0.js";import"./index.f7b7cb5d.js";import"./index.182b7916.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="232b1b3c-be5b-476a-a125-1c2bcb7132e0",a._sentryDebugIdIdentifier="sentry-dbid-232b1b3c-be5b-476a-a125-1c2bcb7132e0")}catch{}})();const nt=_({__name:"Organizations",setup(a){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>d.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},b=async t=>{const o=await d.create(t.name);s({key:o.id})},f=async({key:t})=>{var e,m;await N("Are you sure you want to delete this organization?")&&(await((m=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:m.delete()),g())},y=h(()=>{var t,o;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(t=r.value)==null?void 0:t.map(e=>({key:e.id,cells:[{text:e.name,link:`/organizations/${encodeURIComponent(e.id)}`},{text:e.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:f,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(k(),C(B,null,{navbar:c(()=>[l(D,{breadcrumb:n})]),content:c(()=>[l(A,{"entity-name":"organization",loading:O(u),title:"My organizations",description:"An organization is your company\u2019s account. Add co-workers, manage their access, organize projects and billing.","create-button-text":"Create Organization","empty-title":"No organizations here yet",table:y.value,fields:i,onCreate:b},null,8,["loading","table"])]),_:1}))}});export{nt as default};
//# sourceMappingURL=Organizations.174557a6.js.map
