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.c4f3de67.js";import{e as x,d as I}from"./icons.49e74e71.js";import{a as v}from"./asyncComputed.c75b06d6.js";import"./router.88734ca5.js";import{O as l}from"./organization.73e64f9c.js";import"./columns.aa61756c.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.056998e5.js";import{C as D}from"./CrudView.4072ea68.js";import{B}from"./BaseLayout.3a885926.js";import{a as N}from"./ant-design.a1a552ac.js";import"./Base.9ed9c296.js";import"./transButton.ebe60b80.js";import"./Text.fcf8f28f.js";import"./Title.345a4775.js";import"./index.db3809d7.js";import"./gateway.5578a098.js";import"./record.685c8ba7.js";import"./pubsub.1842fa2d.js";import"./logo.084e5d7c.js";import"./index.205feec3.js";import"./url.d2782274.js";import"./index.c4339fad.js";import"./index.b168b141.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]="91b85562-3beb-43af-813d-e424c4c40b10",o._sentryDebugIdIdentifier="sentry-dbid-91b85562-3beb-43af-813d-e424c4c40b10")}catch{}})();const et=_({__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:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const a=await l.create(t.name);s({key:a.id})},b=async({key:t})=>{var e,c;await N("Are you sure you want to delete this organization?")&&(await((c=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:c.delete()),g())},y=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(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:b,dangerous:!0}]}]})))!=null?a:[]}});return(t,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{et as default};
//# sourceMappingURL=Organizations.36e23a8b.js.map
