import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.a3cf86d4.js";import{a as I}from"./asyncComputed.1cc21e38.js";import{b as k}from"./router.7ac4af4b.js";import"./index.d3453ff4.js";import{M as n}from"./member.3210c85b.js";import{C as x}from"./CrudView.f083926d.js";import{K as C}from"./icons.71dd468a.js";import{a as M}from"./ant-design.c1da1bcc.js";import"./Form.48a2d714.js";import"./hasIn.c81db0e4.js";import"./index.cf4c23b9.js";import"./record.284ed593.js";import"./pubsub.f3afa6c4.js";import"./Paragraph.d0378343.js";import"./Base.438220fe.js";import"./Typography.2d337449.js";import"./Modal.a36dd52c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7f8bc1c2.js";import"./url.eef7d5cb.js";import"./index.3c8fbafb.js";import"./Title.abc37adf.js";import"./Text.c33f164a.js";import"./index.1c110c61.js";import"./index.9041dcba.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]="58e1e62a-81ab-4912-a7f4-93c850149a1f",t._sentryDebugIdIdentifier="sentry-dbid-58e1e62a-81ab-4912-a7f4-93c850149a1f")}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.b04146c4.js.map
