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.a8447bcb.js";import{e as x,b as I}from"./icons.6de7af10.js";import{a as v}from"./asyncComputed.6c2627ea.js";import"./router.8be149da.js";import{O as l}from"./organization.2a96d937.js";import"./columns.79610386.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.2c1ba6ce.js";import{C as A}from"./CrudView.996cd8b2.js";import{B}from"./BaseLayout.f14ed0a1.js";import{a as N}from"./ant-design.1bcd10c9.js";import"./Form.a869b3cf.js";import"./Title.4127a4b4.js";import"./transButton.26020e2e.js";import"./Text.722e2789.js";import"./index.41d49230.js";import"./gateway.9d217caa.js";import"./activeRecord.52c1b6f8.js";import"./pubsub.3b516de1.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.5fa32c06.js";import"./index.251d2c0f.js";import"./url.0a1547fb.js";import"./index.ee9a096e.js";import"./index.c058ebd2.js";import"./index.823e1eed.js";import"./index.71f713cd.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="9199446e-e7d1-4acb-929d-49b51e84ae53",a._sentryDebugIdIdentifier="sentry-dbid-9199446e-e7d1-4acb-929d-49b51e84ae53")}catch{}})();const it=_({__name:"Organizations",setup(a){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:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const o=await l.create(t.name);s({key:o.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()),g())},b=h(()=>{var t,o;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(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?o:[]}});return(t,o)=>(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:f},null,8,["loading","table"])]),_:1}))}});export{it as default};
//# sourceMappingURL=Organizations.8812bada.js.map
