Sha256: b7638575237b704b8df77beb85da9894d22766fb2d5b44fbcd23c3657fe1dfe6
Contents?: true
Size: 1.59 KB
Versions: 16
Compression:
Stored size: 1.59 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" onSelect={(evt, subTab) => hashHistory.push(subTab)} activeKey={pathname?.split('/')[2]} isSecondary > {SECONDARY_TABS.map(({ key, title }) => ( <Tab 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
16 entries across 16 versions & 1 rubygems