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.d6334d0e.js";import{e as x,b as I}from"./icons.09e1f108.js";import{a as v}from"./asyncComputed.95fd0999.js";import"./router.c9839d0e.js";import{O as l}from"./organization.bb04fda1.js";import"./columns.6b92da60.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.321a03d1.js";import{C as A}from"./CrudView.a040df87.js";import{B}from"./BaseLayout.17a4d39d.js";import{a as N}from"./ant-design.765336cf.js";import"./Form.afe8a620.js";import"./Title.132c3f7f.js";import"./transButton.97ae4a5a.js";import"./Text.2f6a30da.js";import"./index.85dd1fea.js";import"./gateway.78108c4a.js";import"./activeRecord.aa738a85.js";import"./pubsub.9d7d329e.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.6da051f8.js";import"./index.02b3bfd1.js";import"./url.dce42ecb.js";import"./index.9476b093.js";import"./index.e0fb68fa.js";import"./index.98d66b02.js";import"./index.2221e01c.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]="ef875bd5-8f1e-4cab-a48e-e1a9e5809826",o._sentryDebugIdIdentifier="sentry-dbid-ef875bd5-8f1e-4cab-a48e-e1a9e5809826")}catch{}})();const ie=_({__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:e})=>{p.push({name:"organization",params:{organizationId:e}})},g=async e=>{const a=await l.create(e.name);s({key:a.id})},y=async({key:e})=>{var t,m;await N("Are you sure you want to delete this organization?")&&(await((m=(t=r.value)==null?void 0:t.find(z=>z.id===e))==null?void 0:m.delete()),f())},b=h(()=>{var e,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?a:[]}});return(e,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:b.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{ie as default};
//# sourceMappingURL=Organizations.ed84ca3c.js.map
