responseStatusCodeCell.tsx 548 B

123456789101112131415161718192021222324
  1. import {Tooltip} from 'sentry/components/tooltip';
  2. import {tct} from 'sentry/locale';
  3. import {HTTP_RESPONSE_STATUS_CODES} from 'sentry/views/insights/http/data/definitions';
  4. interface Props {
  5. code: number;
  6. }
  7. export function ResponseStatusCodeCell({code}: Props) {
  8. const explanation = HTTP_RESPONSE_STATUS_CODES[code.toString()];
  9. return (
  10. <Tooltip
  11. disabled={!code}
  12. isHoverable
  13. title={tct('Status Code [code] “[explanation]”', {
  14. code,
  15. explanation,
  16. })}
  17. >
  18. {code}
  19. </Tooltip>
  20. );
  21. }