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.a5fcf389.js";import{e as x,d as I}from"./icons.1a1dc210.js";import{a as v}from"./asyncComputed.b7d3265e.js";import"./router.8a74f04b.js";import"./index.b67da7e9.js";import{O as l}from"./organization.269baf36.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.49949a9a.js";import{C as D}from"./CrudView.cee1047f.js";import{B}from"./BaseLayout.19687f5a.js";import{a as N}from"./ant-design.35ff28ee.js";import"./Base.175f3ec4.js";import"./transButton.fc314012.js";import"./Text.d2260f67.js";import"./Title.42ad4bfb.js";import"./index.39083dd8.js";import"./record.e2e84f62.js";import"./pubsub.903f7e54.js";import"./gateway.5878b159.js";import"./logo.084e5d7c.js";import"./index.a675a1a6.js";import"./url.d6641ded.js";import"./index.48f4731a.js";import"./index.5b7d1aca.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]="e7dc1bda-85ee-4df7-8390-0b3b1cb71c30",o._sentryDebugIdIdentifier="sentry-dbid-e7dc1bda-85ee-4df7-8390-0b3b1cb71c30")}catch{}})();const te=_({__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:e})=>{p.push({name:"organization",params:{organizationId:e}})},f=async e=>{const a=await l.create(e.name);s({key:a.id})},b=async({key:e})=>{var t,c;await N("Are you sure you want to delete this organization?")&&(await((c=(t=r.value)==null?void 0:t.find(z=>z.id===e))==null?void 0:c.delete()),g())},y=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:b,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(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:y.value,fields:i,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{te as default};
//# sourceMappingURL=Organizations.1a9b9e5d.js.map
