index.tsx 445 B

123456789101112131415
  1. import TeamStore from 'sentry/stores/teamStore';
  2. import {useLegacyStore} from 'sentry/stores/useLegacyStore';
  3. import Badge, {BadgeProps} from './badge';
  4. function TeamBadge(props: BadgeProps) {
  5. const {teams} = useLegacyStore(TeamStore);
  6. // Get the most up-to-date team from the store
  7. const teamFromStore = teams.find(t => t.id === props.team.id);
  8. return <Badge {...props} team={teamFromStore ?? props.team} />;
  9. }
  10. export {TeamBadge};