import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.12d07fe6.js";import{a as I}from"./asyncComputed.4b96df58.js";import{b as k}from"./router.d820a159.js";import"./index.a1296999.js";import{M as n}from"./member.1153f2fc.js";import{C as x}from"./CrudView.1d47b402.js";import{D as C}from"./icons.f2b4f37f.js";import{a as M}from"./ant-design.7bb70225.js";import"./FormItem.791863a4.js";import"./hasIn.7e305b7d.js";import"./index.cf4c23b9.js";import"./record.9ee5b79a.js";import"./pubsub.1984cbae.js";import"./Paragraph.01fbd56d.js";import"./Base.24118e9f.js";import"./Typography.45a7b8d7.js";import"./Form.a87331b6.js";import"./Modal.f73330d1.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.0bca7c74.js";import"./url.f2a2de62.js";import"./index.04a061be.js";import"./Title.cc650707.js";import"./Text.6b94c3bc.js";import"./index.d055bc8b.js";import"./index.209174e2.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]="5c9b6be8-3d82-47e8-a46f-55f0ed2214fb",t._sentryDebugIdIdentifier="sentry-dbid-5c9b6be8-3d82-47e8-a46f-55f0ed2214fb")}catch{}})();const Y=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 d(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,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:()=>d(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(p),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{Y as default};
//# sourceMappingURL=Members.2e751963.js.map
