import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.65314838.js";import{a as I}from"./asyncComputed.223cd718.js";import{b as k}from"./router.816e015d.js";import"./index.b4329a73.js";import{M as n}from"./member.0af08b4a.js";import{C as x}from"./CrudView.7d5462c4.js";import{F as C}from"./icons.273c97a3.js";import{a as M}from"./ant-design.490e2e88.js";import"./FormItem.d018a0cf.js";import"./hasIn.c524fe42.js";import"./index.cf4c23b9.js";import"./record.2b771177.js";import"./pubsub.07a23b99.js";import"./Paragraph.8de48e53.js";import"./Base.c866b7a3.js";import"./Form.61485628.js";import"./Modal.80efbd65.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f5720da4.js";import"./url.209588c6.js";import"./index.5a0acee3.js";import"./Title.465916fc.js";import"./Text.171782d7.js";import"./index.673377ae.js";import"./index.4cb9cc94.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]="53e9308b-ecc1-4fbf-85be-d6f36fb254f4",t._sentryDebugIdIdentifier="sentry-dbid-53e9308b-ecc1-4fbf-85be-d6f36fb254f4")}catch{}})();const X=b({__name:"Members",setup(t){const r=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(r,e.email),m()};async function p(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:d,result:f,refetch:m}=I(()=>n.list(r)),u=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(a=(e=f.value)==null?void 0:e.map(o=>{var s;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===o.email?[]:[{icon:C,label:"Remove access",onClick:()=>p(o),dangerous:!0}]}]}}))!=null?a:[]}});return(e,a)=>(_(),w(x,{"entity-name":"members",loading:h(d),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.4313a744.js.map
