import{d as _,ez as w,J as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.cf5b7366.js";import{e as x,b as I}from"./icons.c510a141.js";import{a as v}from"./asyncComputed.2caa7fe6.js";import"./router.565b4739.js";import{O as l}from"./organization.4a30a51b.js";import"./index.2fa55c7c.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.0e12044d.js";import{C as A}from"./CrudView.ca1846b4.js";import{B}from"./BaseLayout.03efcbf5.js";import{a as N}from"./ant-design.55c856ad.js";import"./Title.adce1298.js";import"./index.3d2fbf9e.js";import"./gateway.409ff644.js";import"./activeRecord.f30e02c2.js";import"./pubsub.664a70af.js";import"./logo.084e5d7c.js";import"./index.7622dd54.js";import"./index.10cdfb2c.js";import"./index.21604c00.js";import"./Form.c8affe88.js";import"./url.fb40e08c.js";import"./index.47f17eed.js";import"./index.aee8b5d5.js";import"./index.9583d9e9.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="eaf2e5f1-7bfc-4b9a-b95f-d16b7bd2a747",o._sentryDebugIdIdentifier="sentry-dbid-eaf2e5f1-7bfc-4b9a-b95f-d16b7bd2a747")}catch{}})();const at=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:f}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const a=await l.create(t.name);s({key:a.id})},b=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()),f())},y=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(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:b,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(k(),C(B,null,{navbar:c(()=>[d(D,{breadcrumb:n})]),content:c(()=>[d(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:g},null,8,["loading","table"])]),_:1}))}});export{at as default};
//# sourceMappingURL=Organizations.ffa6aaa2.js.map
