import{d as _,eA as w,G as h,b as k,c as C,w as m,f as d,u as O}from"./outputWidgets.e822ff0f.js";import{e as x,d as I}from"./icons.0ab0d55f.js";import{a as v}from"./asyncComputed.68870ff7.js";import"./router.8fbd98d9.js";import"./index.3b830ff3.js";import{O as l}from"./organization.4f94a2b2.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.be210b7c.js";import{C as D}from"./CrudView.0a0ee0a6.js";import{B}from"./BaseLayout.24b42efe.js";import{a as N}from"./ant-design.e2b10503.js";import"./Base.775de4d5.js";import"./transButton.f06af665.js";import"./Text.4c9d53a2.js";import"./Title.5afb3003.js";import"./index.bf8163eb.js";import"./record.edca104e.js";import"./pubsub.ae710ef5.js";import"./gateway.349a9491.js";import"./logo.084e5d7c.js";import"./index.e8141e2b.js";import"./url.c786ab78.js";import"./index.eb9667df.js";import"./index.1b95bbbc.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]="ae86c47a-7657-4225-a188-ecad78a0aaed",o._sentryDebugIdIdentifier="sentry-dbid-ae86c47a-7657-4225-a188-ecad78a0aaed")}catch{}})();const ea=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>l.list()),s=({key:a})=>{p.push({name:"organization",params:{organizationId:a}})},f=async a=>{const t=await l.create(a.name);s({key:t.id})},y=async({key:a})=>{var e,c;await N("Are you sure you want to delete this organization?")&&(await((c=(e=r.value)==null?void 0:e.find(z=>z.id===a))==null?void 0:c.delete()),g())},b=h(()=>{var a,t;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(t=(a=r.value)==null?void 0:a.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?t:[]}});return(a,t)=>(k(),C(B,null,{navbar:m(()=>[d(A,{breadcrumb:n})]),content:m(()=>[d(D,{"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:f},null,8,["loading","table"])]),_:1}))}});export{ea as default};
//# sourceMappingURL=Organizations.9d8d3556.js.map
