browserOSIcons.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import {Fragment} from 'react';
  2. import ContextIcon from 'sentry/components/replays/contextIcon';
  3. import {useReplayContext} from 'sentry/components/replays/replayContext';
  4. import {Tooltip} from 'sentry/components/tooltip';
  5. export default function BrowserOSIcons({showBrowser = true}: {showBrowser?: boolean}) {
  6. const {replay} = useReplayContext();
  7. const replayRecord = replay?.getReplay();
  8. return (
  9. <Fragment>
  10. <Tooltip title={`${replayRecord?.os.name ?? ''} ${replayRecord?.os.version ?? ''}`}>
  11. <ContextIcon
  12. name={replayRecord?.os.name ?? ''}
  13. version={replayRecord?.os.version ?? undefined}
  14. showVersion
  15. />
  16. </Tooltip>
  17. {showBrowser && (
  18. <Tooltip
  19. title={`${replayRecord?.browser.name ?? ''} ${
  20. replayRecord?.browser.version ?? ''
  21. }`}
  22. >
  23. <ContextIcon
  24. name={replayRecord?.browser.name ?? ''}
  25. version={replayRecord?.browser.version ?? undefined}
  26. showVersion
  27. />
  28. </Tooltip>
  29. )}
  30. </Fragment>
  31. );
  32. }