iconWrapper.tsx 691 B

123456789101112131415161718192021222324252627
  1. import styled from '@emotion/styled';
  2. import type {SVGIconProps} from 'sentry/icons/svgIcon';
  3. /**
  4. * Taken `from events/interfaces/.../breadcrumbs/types`
  5. */
  6. const IconWrapper = styled('div')<
  7. {hasOccurred: boolean} & Required<Pick<SVGIconProps, 'color'>>
  8. >`
  9. display: flex;
  10. align-items: center;
  11. justify-content: center;
  12. width: 24px;
  13. min-width: 24px;
  14. height: 24px;
  15. border-radius: 50%;
  16. color: ${p => p.theme.white};
  17. background: ${p => p.theme[p.color] ?? p.color};
  18. position: relative;
  19. opacity: ${p => (p.hasOccurred ? 1 : 0.8)};
  20. /* Make sure the icon is above the line through the back */
  21. z-index: ${p => p.theme.zIndex.initial};
  22. `;
  23. export default IconWrapper;