statusTooltip.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import styled from '@emotion/styled';
  2. import Tooltip from 'sentry/components/tooltip';
  3. import space from 'sentry/styles/space';
  4. import {ImageCandidate} from 'sentry/types/debugImage';
  5. import {getStatusTooltipDescription} from '../utils';
  6. import Status from '.';
  7. type Props = {
  8. candidate: ImageCandidate;
  9. hasReprocessWarning: boolean;
  10. };
  11. function StatusTooltip({candidate, hasReprocessWarning}: Props) {
  12. const {download} = candidate;
  13. const {label, description, disabled} = getStatusTooltipDescription(
  14. candidate,
  15. hasReprocessWarning
  16. );
  17. return (
  18. <Tooltip
  19. title={
  20. label && (
  21. <Title>
  22. <Label>{label}</Label>
  23. {description && <div>{description}</div>}
  24. </Title>
  25. )
  26. }
  27. disabled={disabled}
  28. >
  29. <Status status={download.status} />
  30. </Tooltip>
  31. );
  32. }
  33. export default StatusTooltip;
  34. const Title = styled('div')`
  35. text-align: left;
  36. `;
  37. const Label = styled('div')`
  38. display: inline-block;
  39. margin-bottom: ${space(0.25)};
  40. `;