import{a as u}from"./chunk-FEQJ4I73.mjs";import{a as k}from"./chunk-Q34CR4NZ.mjs";import{a as R}from"./chunk-4ZXCZVKI.mjs";import{a as M}from"./chunk-KY323GRB.mjs";import{c as P,d as x}from"./chunk-A5QFDUFT.mjs";import{useCurrentProfile as T}from"@baseapp-frontend/authentication";import{AvatarWithPlaceholder as O}from"@baseapp-frontend/design-system/components/web/avatars";import{ThreeDotsIcon as _}from"@baseapp-frontend/design-system/components/web/icons";import{Popover as j}from"@baseapp-frontend/design-system/components/web/popovers";import{usePopover as S}from"@baseapp-frontend/design-system/hooks/common";import{Box as r,IconButton as L,Typography as f}from"@mui/material";import{useFragment as B}from"react-relay";import{jsx as e,jsxs as a}from"react/jsx-runtime";var F=function(m){var h=m.hasAdminPermissions,i=m.groupMember,A=m.initiateRemoval,n=B(M,i.profile),d=n.id,s=n.image,v=n.name,t=n.urlPath,C=!!(t!=null&&t.path),g=i?.role===P.admin,b=h,w=T(),c=w.currentProfile,o=S(),l=c?.id===d,p=function(){o.onClose(),A(d,v)},I=function(){return l?e(u,{isMe:l,onViewProfileClicked:o.onClose,onRemoveClicked:p}):!l&&h?e(k,{onViewProfileClicked:o.onClose,onToggleAdminClicked:o.onClose,onRemoveClicked:p}):e(u,{isMe:l,onViewProfileClicked:o.onClose,onRemoveClicked:p})};return a(R,{children:[e(O,{width:48,height:48,src:s?.url,sx:{alignSelf:"center",justifySelf:"center"}}),a(r,{sx:{display:"grid",gridTemplateRows:"repeat(2, minmax(0, 1fr))"},children:[e(f,{variant:"subtitle2",children:v}),a(r,{sx:{alignItems:"center",display:"grid",gridTemplateColumns:"min-content min-content min-content"},children:[e(f,{variant:"caption",color:"text.secondary",children:C&&"@".concat(t.path)}),g&&C&&e(r,{sx:{display:"inline-block",height:"6px",width:"6px",borderRadius:"50%",backgroundColor:"text.disabled",marginX:"8px"}}),e(f,{variant:"caption",color:"primary.light",children:g&&x})]})]}),b?a(r,{children:[e(L,{onClick:o.onOpen,"aria-label":"Show admin options",children:e(_,{sx:{fontSize:"24px"}})}),e(j,{open:o.open,onClose:o.onClose,children:I()})]}):e(r,{})]},"profile-".concat(d))},Y=F;export{Y as a};
//# sourceMappingURL=chunk-V22MQ5FT.mjs.map