import React from 'react';
import { shape, string, number, element, arrayOf } from 'prop-types';
import { Tab, Tabs, TabTitleText } from '@patternfly/react-core';
import { Switch, Route, Redirect, useLocation, withRouter, HashRouter } from 'react-router-dom';
import { head, last } from 'lodash';
const RoutedTabs = ({
tabs, defaultTabIndex,
}) => {
const {
hash, key: locationKey,
} = useLocation();
// The below transforms #/history/6 to history
const currentTabFromUrl = head(last(hash.split('#/')).split('/'));
return (
<>