errorCount.tsx 605 B

12345678910111213141516171819202122232425262728
  1. import styled from '@emotion/styled';
  2. import {IconFire} from 'sentry/icons';
  3. import {space} from 'sentry/styles/space';
  4. type Props = {
  5. countErrors: number;
  6. className?: string;
  7. };
  8. const ErrorCount = styled(({countErrors, className}: Props) =>
  9. countErrors ? (
  10. <span className={className}>
  11. <IconFire />
  12. {countErrors}
  13. </span>
  14. ) : (
  15. <span className={className}>0</span>
  16. )
  17. )`
  18. display: flex;
  19. align-items: center;
  20. gap: ${space(0.5)};
  21. color: ${p => (p.countErrors > 0 ? p.theme.red400 : 'inherit')};
  22. font-variant-numeric: tabular-nums;
  23. `;
  24. export default ErrorCount;