import{d as _,ez as w,J as h,b as k,c as C,w as c,f as l,u as O}from"./outputWidgets.5ced94d7.js";import{e as x,b as I}from"./icons.157295a5.js";import{a as v}from"./asyncComputed.6f213f9d.js";import"./router.c33f3e79.js";import{O as d}from"./organization.44bb6c7b.js";import"./index.13e3df9c.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.2a7c3217.js";import{C as A}from"./CrudView.1c9778e2.js";import{B}from"./BaseLayout.a4af420b.js";import{a as N}from"./ant-design.49bf0c8e.js";import"./Title.74cb802d.js";import"./index.48bbb941.js";import"./gateway.06420003.js";import"./activeRecord.6ae8bce9.js";import"./pubsub.f395e26b.js";import"./logo.084e5d7c.js";import"./index.8ea91ac5.js";import"./index.fe1573f2.js";import"./index.2a4a437f.js";import"./Form.3717142f.js";import"./url.b91ad4a3.js";import"./index.54325f84.js";import"./index.d48bc6c3.js";import"./index.c946e10c.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]="32f36210-b6ef-4238-9779-9ac8aa36f7e8",o._sentryDebugIdIdentifier="sentry-dbid-32f36210-b6ef-4238-9779-9ac8aa36f7e8")}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(()=>d.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const a=await d.create(t.name);s({key:a.id})},y=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())},b=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:y,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(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:b.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{at as default};
//# sourceMappingURL=Organizations.c055b779.js.map
