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.0ed3a637.js";import{e as x,a as I}from"./icons.8d5441dc.js";import{a as v}from"./asyncComputed.054ae312.js";import"./router.d8af0f7d.js";import{O as l}from"./organization.bd1b7f8e.js";import"./columns.15b333c9.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.01a04e6e.js";import{C as D}from"./CrudView.931c84f7.js";import{B}from"./BaseLayout.93df0706.js";import{a as N}from"./ant-design.b8da9ea1.js";import"./Base.69739fb7.js";import"./transButton.3ca23b61.js";import"./Text.e89a9af1.js";import"./Title.53f943d2.js";import"./index.230ffe19.js";import"./gateway.678b6185.js";import"./activeRecord.e0ef2424.js";import"./pubsub.5dd4605f.js";import"./logo.084e5d7c.js";import"./index.e62d6d0c.js";import"./url.4f7be002.js";import"./index.0f5ee3e7.js";import"./index.feaa4503.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]="a2fc06bc-7cde-4265-afb4-10059f474ac8",o._sentryDebugIdIdentifier="sentry-dbid-a2fc06bc-7cde-4265-afb4-10059f474ac8")}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(()=>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})},y=async({key:t})=>{var a,c;await N("Are you sure you want to delete this organization?")&&(await((c=(a=r.value)==null?void 0:a.find(z=>z.id===t))==null?void 0:c.delete()),f())},b=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:y,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(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:g},null,8,["loading","table"])]),_:1}))}});export{at as default};
//# sourceMappingURL=Organizations.60e9141a.js.map
