import { Tabs } from 'src/components';
import { useLocation } from 'react-router-dom';
import { TypePages } from '../../type';

function TabListTeleport() {
  const location = useLocation();
  const locationSplit = location.pathname.replace(/^\/|\/$/g, '').split('/');
  const active = Object.values(TypePages).find(
    (item) => item === locationSplit[1]
  );

  if (!active) {
    return null;
  }
  return (
    <Tabs
      selected={active}
      options={Object.keys(TypePages).map((key) => ({ to: key, key }))}
    />
  );
}

export default TabListTeleport;

Synonyms

cyb/src/containers/governance/tabList.tsx
cyb/src/containers/warp/components/tabList.tsx
pussy-ts/src/containers/warp/components/tabList.tsx
cyb/src/pages/teleport/components/tabList/TabList.tsx

Neighbours