participants.tsx 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import styled from '@emotion/styled';
  2. import UserAvatar from 'sentry/components/avatar/userAvatar';
  3. import * as SidebarSection from 'sentry/components/sidebarSection';
  4. import {tn} from 'sentry/locale';
  5. import space from 'sentry/styles/space';
  6. import {Group} from 'sentry/types';
  7. type Props = {
  8. participants: Group['participants'];
  9. };
  10. const GroupParticipants = ({participants}: Props) => (
  11. <SidebarSection.Wrap>
  12. <SidebarSection.Title>
  13. {tn('%s Participant', '%s Participants', participants.length)}
  14. </SidebarSection.Title>
  15. <SidebarSection.Content>
  16. <Faces>
  17. {participants.map(user => (
  18. <Face key={user.username}>
  19. <UserAvatar size={28} user={user} hasTooltip />
  20. </Face>
  21. ))}
  22. </Faces>
  23. </SidebarSection.Content>
  24. </SidebarSection.Wrap>
  25. );
  26. export default GroupParticipants;
  27. const Faces = styled('div')`
  28. display: flex;
  29. flex-wrap: wrap;
  30. `;
  31. const Face = styled('div')`
  32. margin-right: ${space(0.5)};
  33. margin-bottom: ${space(0.5)};
  34. `;