topResultsIndicator.tsx 649 B

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