responseStatusCodeCell.tsx 684 B

12345678910111213141516171819202122232425
  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. // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
  9. const explanation = HTTP_RESPONSE_STATUS_CODES[code.toString()];
  10. return (
  11. <Tooltip
  12. disabled={!code}
  13. isHoverable
  14. title={tct('Status Code [code] “[explanation]”', {
  15. code,
  16. explanation,
  17. })}
  18. >
  19. {code}
  20. </Tooltip>
  21. );
  22. }