topResultsIndicator.tsx 710 B

123456789101112131415161718192021222324252627
  1. import styled from '@emotion/styled';
  2. import {getChartColorPalette} from 'sentry/constants/chartPalette';
  3. type TopResultsIndicatorProps = {
  4. count: number;
  5. index: number;
  6. };
  7. export const TopResultsIndicator = styled('div')<TopResultsIndicatorProps>`
  8. position: absolute;
  9. left: -1px;
  10. margin-top: 4.5px;
  11. width: 9px;
  12. height: 15px;
  13. border-radius: 0 3px 3px 0;
  14. background-color: ${p => {
  15. // this background color needs to match the colors used in
  16. // app/components/charts/eventsChart so that the ordering matches
  17. // the color pallete contains n + 2 colors, so we subtract 2 here
  18. return getChartColorPalette(p.count - 2)?.[p.index];
  19. }};
  20. `;
  21. export default TopResultsIndicator;