sideTabs.tsx 689 B

1234567891011121314151617181920212223242526272829
  1. import NavTabs from 'sentry/components/navTabs';
  2. import {t} from 'sentry/locale';
  3. import useUrlParams from 'sentry/utils/replays/hooks/useUrlParams';
  4. type Props = {};
  5. const TABS = {
  6. video: t('Replay'),
  7. tags: t('Tags'),
  8. };
  9. function SideTabs({}: Props) {
  10. const {getParamValue, setParamValue} = useUrlParams('t_side', 'video');
  11. const active = getParamValue();
  12. return (
  13. <NavTabs underlined>
  14. {Object.entries(TABS).map(([tab, label]) => {
  15. return (
  16. <li key={tab} className={active === tab ? 'active' : ''}>
  17. <a onClick={() => setParamValue(tab)}>{label}</a>
  18. </li>
  19. );
  20. })}
  21. </NavTabs>
  22. );
  23. }
  24. export default SideTabs;