import{d as _,ey as w,H as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.1739e6b5.js";import{e as x,b as I}from"./icons.1c3e2bde.js";import{a as v}from"./asyncComputed.b4d87a94.js";import"./router.95125983.js";import{O as l}from"./organization.978206c9.js";import"./columns.0d2e1661.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.77f3083c.js";import{C as A}from"./CrudView.245e4133.js";import{B}from"./BaseLayout.afdc77f1.js";import{a as N}from"./ant-design.6ecbca2a.js";import"./Title.1261c75a.js";import"./index.92715e30.js";import"./gateway.8b5d469f.js";import"./activeRecord.55a23e4a.js";import"./pubsub.e4395938.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./Text.f4c0ef3e.js";import"./index.fbff59b3.js";import"./index.ef7ab7ff.js";import"./Form.6a4829ad.js";import"./url.8bddfe76.js";import"./index.aaa812ca.js";import"./index.663f575e.js";import"./index.366cf7e1.js";import"./index.8b3d4030.js";import"./index.55ff2de5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8a2b4382-c2a8-4d49-ba61-f603f95abc29",e._sentryDebugIdIdentifier="sentry-dbid-8a2b4382-c2a8-4d49-ba61-f603f95abc29")}catch{}})();const it=_({__name:"Organizations",setup(e){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 o=await l.create(t.name);s({key:o.id})},b=async({key:t})=>{var a,m;await N("Are you sure you want to delete this organization?")&&(await((m=(a=r.value)==null?void 0:a.find(z=>z.id===t))==null?void 0:m.delete()),f())},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(a=>({key:a.id,cells:[{text:a.name,link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(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{it as default};
//# sourceMappingURL=Organizations.7776daef.js.map
