import{d as _,eA as w,G as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.427e9347.js";import{e as x,b as I}from"./icons.2a865956.js";import{a as v}from"./asyncComputed.32abd7c2.js";import"./router.1a20c20c.js";import{O as l}from"./organization.432163c5.js";import"./columns.eab062cb.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.54b32cf1.js";import{C as D}from"./CrudView.22a93e62.js";import{B}from"./BaseLayout.0abe2ed6.js";import{a as N}from"./ant-design.484e81b9.js";import"./Base.dbea8db9.js";import"./FormItem.e1548cef.js";import"./transButton.470f2fe6.js";import"./Text.31458a16.js";import"./Title.213e158e.js";import"./index.e440fe17.js";import"./gateway.5f288bf8.js";import"./activeRecord.91f10272.js";import"./pubsub.9b59356e.js";import"./index.cf4c23b9.js";import"./logo.084e5d7c.js";import"./index.e58605b8.js";import"./url.9044ee0d.js";import"./index.8fcd530b.js";import"./index.36e3a141.js";import"./index.3804082b.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]="aff10703-1627-4d1f-aa91-6bf6bba40ea2",o._sentryDebugIdIdentifier="sentry-dbid-aff10703-1627-4d1f-aa91-6bf6bba40ea2")}catch{}})();const nt=_({__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 e=await l.create(t.name);s({key:e.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,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(e=(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?e:[]}});return(t,e)=>(k(),C(B,null,{navbar:c(()=>[d(A,{breadcrumb:n})]),content:c(()=>[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:y.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{nt as default};
//# sourceMappingURL=Organizations.6d1bf5e8.js.map
