Sha256: c7b03579ea8ceed480cece5359a516664d90e2b92439645f9e5f8e6a8e0f5345
Contents?: true
Size: 1.69 KB
Versions: 20
Compression:
Stored size: 1.69 KB
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { Tabs, Tab, TabTitleText } from '@patternfly/react-core'; import { useHistory } from 'react-router-dom'; import SkeletonLoader from 'foremanReact/components/common/SkeletonLoader'; import SecondaryTabRoutes from './components/SecondaryTabRoutes'; import { SECONDARY_TABS } from './constants'; import './AnsibleHostDetail.scss'; const AnsibleHostDetail = ({ response, status, router, location: { pathname }, history, }) => { const hashHistory = useHistory(); return ( <SkeletonLoader status={status} skeletonProps={{ count: 5 }}> {response?.id && ( <> <Tabs className="ansible-host-details-tabs" ouiaId="ansible-host-details-tabs" onSelect={(evt, subTab) => hashHistory.push(subTab)} activeKey={pathname?.split('/')[2]} isSecondary > {SECONDARY_TABS.map(({ key, title }) => ( <Tab ouiaId={`ansible-host-details-tabs-${title}`} key={key} eventKey={key} title={<TabTitleText>{title}</TabTitleText>} /> ))} </Tabs> <SecondaryTabRoutes response={response} router={router} history={history} /> </> )} </SkeletonLoader> ); }; AnsibleHostDetail.propTypes = { response: PropTypes.object.isRequired, status: PropTypes.string.isRequired, location: PropTypes.object, router: PropTypes.object.isRequired, history: PropTypes.object.isRequired, }; AnsibleHostDetail.defaultProps = { location: { pathname: '' }, }; export default AnsibleHostDetail;
Version data entries
20 entries across 20 versions & 1 rubygems