import React from 'react';
import {
DescriptionList,
DescriptionListTerm,
DescriptionListGroup,
DescriptionListDescription,
Card,
CardHeader,
CardTitle,
CardBody,
Flex,
FlexItem,
GridItem,
Label,
} from '@patternfly/react-core';
import { urlBuilder } from 'foremanReact/common/urlHelpers';
import { translate as __ } from 'foremanReact/common/I18n';
import { propsToCamelCase } from 'foremanReact/common/helpers';
import PropTypes from 'prop-types';
import ContentViewIcon from '../../../../scenes/ContentViews/components/ContentViewIcon';
const HostContentViewDetails = ({
contentView, lifecycleEnvironment, contentViewVersionId,
contentViewVersion, contentViewVersionLatest,
}) => {
let versionLabel = `Version ${contentViewVersion}`;
if (contentViewVersionLatest) {
versionLabel += ' (latest)';
}
return (
{__('Content View Details')}
{__('Content View')}
{`${contentView.name}`}
{__('Version in use')}
{versionLabel}
);
};
const ContentViewDetailsCard = ({ hostDetails }) => {
if (hostDetails.content_facet_attributes) {
return ;
}
return null;
};
HostContentViewDetails.propTypes = {
contentView: PropTypes.shape({
name: PropTypes.string,
id: PropTypes.number,
composite: PropTypes.bool,
}).isRequired,
lifecycleEnvironment: PropTypes.shape({
name: PropTypes.string,
id: PropTypes.number,
}).isRequired,
contentViewVersionId: PropTypes.number.isRequired,
contentViewVersion: PropTypes.string.isRequired,
contentViewVersionLatest: PropTypes.bool.isRequired,
};
ContentViewDetailsCard.propTypes = {
hostDetails: PropTypes.shape({
content_facet_attributes: PropTypes.shape({}),
}),
};
ContentViewDetailsCard.defaultProps = {
hostDetails: {},
};
export default ContentViewDetailsCard;