import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.74ac2ec4.js";import{a as I}from"./asyncComputed.f88a4b94.js";import{b as k}from"./router.3342c4c3.js";import"./index.8e718568.js";import{M as n}from"./member.51878182.js";import{C as x}from"./CrudView.300a16f4.js";import{D as C}from"./icons.f62d7c23.js";import{a as M}from"./ant-design.ba20537e.js";import"./FormItem.bf6c91bc.js";import"./hasIn.88fbb4e5.js";import"./index.cf4c23b9.js";import"./record.a15934e9.js";import"./pubsub.6d093b2e.js";import"./Paragraph.d67398fc.js";import"./Base.bd01be9c.js";import"./Form.9d6d8c17.js";import"./Modal.fae7bce9.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.30b53c7c.js";import"./url.c37f3fbe.js";import"./index.ba7b32c9.js";import"./Title.e4bf994e.js";import"./Text.039f7ef4.js";import"./index.08be46f9.js";import"./index.8324d637.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]="868c754e-8065-45b1-b1af-0b6c1e441bfe",t._sentryDebugIdIdentifier="sentry-dbid-868c754e-8065-45b1-b1af-0b6c1e441bfe")}catch{}})();const X=b({__name:"Members",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(a,e.email),m()};async function p(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,result:u,refetch:m}=I(()=>n.list(a)),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(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?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.c4575790.js.map
