import{d as b,eB as y,G as g,b as _,c as w,u as h}from"./outputWidgets.49a82d72.js";import{a as I}from"./asyncComputed.eabe06e7.js";import{b as k}from"./router.a6168245.js";import"./index.21de586b.js";import{M as n}from"./member.317f1794.js";import{C as x}from"./CrudView.af71ec23.js";import{F as C}from"./icons.2150c8c5.js";import{a as M}from"./ant-design.43575ecc.js";import"./FormItem.e4d1b0b2.js";import"./hasIn.fa4a0362.js";import"./index.5029967c.js";import"./index.cf4c23b9.js";import"./record.ddefb071.js";import"./pubsub.6877ebe1.js";import"./Title.d0eedb84.js";import"./Text.183f0e18.js";import"./Form.5245e582.js";import"./Modal.e7dfdcd9.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9e950d61.js";import"./url.58ce58bc.js";import"./index.99c9b8c6.js";import"./index.8af0bb95.js";import"./index.b6a77d69.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]="6590729a-67fb-45e3-b0c2-a13e4abfab88",t._sentryDebugIdIdentifier="sentry-dbid-6590729a-67fb-45e3-b0c2-a13e4abfab88")}catch{}})();const W=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{W as default};
//# sourceMappingURL=Members.16ca5a73.js.map
