import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.1d9bc483.js";import{a as I}from"./asyncComputed.3431552f.js";import{b as k}from"./router.9b42915a.js";import"./index.8feaf127.js";import{M as n}from"./member.3dc8cefd.js";import{C as x}from"./CrudView.4ddb21c1.js";import{K as C}from"./icons.f304c7ce.js";import{a as M}from"./ant-design.76c46701.js";import"./Form.b5179437.js";import"./hasIn.720fa991.js";import"./index.cf4c23b9.js";import"./record.19799987.js";import"./pubsub.1ce944f4.js";import"./Paragraph.fe3e888e.js";import"./Base.1fa74c0b.js";import"./Typography.a8278e90.js";import"./Modal.d0c8d599.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.35e5a90b.js";import"./url.d3539301.js";import"./index.3371bd8d.js";import"./Title.e5c6db47.js";import"./Text.dd7d318a.js";import"./index.76b6c31d.js";import"./index.75d5d1da.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]="d904d603-5c05-4ab2-a5d7-dd0407931b23",t._sentryDebugIdIdentifier="sentry-dbid-d904d603-5c05-4ab2-a5d7-dd0407931b23")}catch{}})();const X=b({__name:"Members",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(a,e.email),m()};async function c(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:()=>c(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:d},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.77ce10a8.js.map
