participants.tsx 850 B

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