import {Fragment, useState} from 'react'; import styled from '@emotion/styled'; import {AnimatePresence, motion} from 'framer-motion'; import Avatar from 'sentry/components/avatar'; import TeamAvatar from 'sentry/components/avatar/teamAvatar'; import {Button} from 'sentry/components/button'; import {IconChevron} from 'sentry/icons'; import {t, tn} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Team, User} from 'sentry/types'; interface ParticipantScrollboxProps { teams: Team[]; users: User[]; } function ParticipantScrollbox({users, teams}: ParticipantScrollboxProps) { if (!users.length && !teams.length) { return null; } const showHeaders = users.length > 0 && teams.length > 0; return ( {showHeaders && {t('Teams (%s)', teams.length)}} {teams.map(team => (
{`#${team.slug}`} {tn('%s member', '%s members', team.memberCount)}
))} {showHeaders && {t('Individuals (%s)', users.length)}} {users.map(user => (
{user.name} {user.email}
))}
); } interface ParticipantListProps { children: React.ReactNode; description: string; users: User[]; teams?: Team[]; } export function ParticipantList({teams = [], users, children}: ParticipantListProps) { const [isExpanded, setIsExpanded] = useState(false); return ( setIsExpanded(!isExpanded)} role="button"> {children}