peopleSection.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {Flex} from 'sentry/components/container/flex';
  2. import ParticipantList from 'sentry/components/group/streamlinedParticipantList';
  3. import {t} from 'sentry/locale';
  4. import {space} from 'sentry/styles/space';
  5. import type {TeamParticipant, UserParticipant} from 'sentry/types/group';
  6. import type {User} from 'sentry/types/user';
  7. import {SidebarSectionTitle} from 'sentry/views/issueDetails/streamline/sidebar/sidebar';
  8. export default function PeopleSection({
  9. userParticipants,
  10. teamParticipants,
  11. viewers,
  12. }: {
  13. teamParticipants: TeamParticipant[];
  14. userParticipants: UserParticipant[];
  15. viewers: User[];
  16. }) {
  17. const hasParticipants = userParticipants.length > 0 || teamParticipants.length > 0;
  18. const hasViewers = viewers.length > 0;
  19. return (
  20. <div>
  21. <SidebarSectionTitle>{t('People')}</SidebarSectionTitle>
  22. {hasParticipants && (
  23. <Flex gap={space(0.5)} align="center">
  24. <ParticipantList users={userParticipants} teams={teamParticipants} />
  25. {t('participating')}
  26. </Flex>
  27. )}
  28. {hasViewers && (
  29. <Flex gap={space(0.5)} align="center">
  30. <ParticipantList users={viewers} />
  31. {t('viewed')}
  32. </Flex>
  33. )}
  34. </div>
  35. );
  36. }