import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.84fe9cdf.js";import{a as I}from"./asyncComputed.6b982433.js";import{b as k}from"./router.55b997dc.js";import"./index.46fac088.js";import{M as n}from"./member.854bcb77.js";import{C as x}from"./CrudView.d7e7652b.js";import{F as C}from"./icons.fb80f0dd.js";import{a as M}from"./ant-design.53be314d.js";import"./FormItem.3f0afd7c.js";import"./hasIn.892e96d0.js";import"./index.cf4c23b9.js";import"./record.d584e714.js";import"./pubsub.e099f5f1.js";import"./Paragraph.7a7aafbc.js";import"./Base.3448c1ef.js";import"./Form.ff60b0b9.js";import"./Modal.47a21763.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.41277f9f.js";import"./url.8de5cd7a.js";import"./index.7b2adc4e.js";import"./Title.59475fea.js";import"./Text.6c3b9f60.js";import"./index.2424aba1.js";import"./index.0be37f33.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="ba77aaa9-1864-4410-8adb-8aa0a0c8e4c8",t._sentryDebugIdIdentifier="sentry-dbid-ba77aaa9-1864-4410-8adb-8aa0a0c8e4c8")}catch{}})();const X=b({__name:"Members",setup(t){const o=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(o,e.email),m()};async function p(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(o,e.authorId),m())}const{loading:d,result:u,refetch:m}=I(()=>n.list(o)),f=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=u.value)==null?void 0:e.map(a=>{var s;return{key:a.email,cells:[{type:"text",text:a.email},{type:"text",text:a.role},{type:"actions",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===a.email?[]:[{icon:C,label:"Remove access",onClick:()=>p(a),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(d),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.99d8baa8.js.map
