import{d as _,eA as w,G as h,b as k,c as C,w as m,f as l,u as O}from"./outputWidgets.6c6bbcfd.js";import{e as x,d as I}from"./icons.89c226d3.js";import{a as v}from"./asyncComputed.77186ed9.js";import"./router.98f12fd8.js";import"./index.fa74f1f3.js";import{O as d}from"./organization.0937221e.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.249bda57.js";import{C as D}from"./CrudView.520a43a0.js";import{B}from"./BaseLayout.41269b73.js";import{a as N}from"./ant-design.ff909c2a.js";import"./Base.d198dcc9.js";import"./transButton.2945a1d9.js";import"./Text.51d0b007.js";import"./Title.307e6445.js";import"./index.d102918e.js";import"./record.5aef9f17.js";import"./pubsub.ccb56b51.js";import"./gateway.3543d1b0.js";import"./logo.084e5d7c.js";import"./index.eb6d3cc3.js";import"./url.bf2db6c1.js";import"./index.9883e2bc.js";import"./index.0e6e05b9.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]="84baf1a5-50ce-49e1-9cf3-9b019e73026c",o._sentryDebugIdIdentifier="sentry-dbid-84baf1a5-50ce-49e1-9cf3-9b019e73026c")}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:f}=v(()=>d.list()),s=({key:e})=>{p.push({name:"organization",params:{organizationId:e}})},g=async e=>{const a=await d.create(e.name);s({key:a.id})},y=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()),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:m(()=>[l(A,{breadcrumb:n})]),content:m(()=>[l(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{te as default};
//# sourceMappingURL=Organizations.0f79f5b0.js.map
