import React from 'react'; import PropTypes from 'prop-types'; import ForemanModal from 'foremanReact/components/ForemanModal'; import { sprintf, translate as __ } from 'foremanReact/common/I18n'; import { Card, CardBody, TextContent, Text, TextList, TextListItem, TextListVariants, TextVariants, } from '@patternfly/react-core'; const generateRepoList = (repoNames, productName) => ( <> {productName} {repoNames.map((repo) => ( {repo} ))} ); const generateProductList = (reposToSubscribe) => ( p.productName)} component={TextListVariants.ol} > {reposToSubscribe.map((p) => generateRepoList(p.repoNames, p.productName))} ); const SCCProductPickerModal = ({ id, taskId, reposToSubscribe }) => ( <> {__('The subscription task with id ')} {sprintf('%s', taskId)} {__(' has started successfully.')} {__('The following products will be imported:')} {generateProductList(reposToSubscribe)} ); SCCProductPickerModal.propTypes = { id: PropTypes.string, taskId: PropTypes.string, reposToSubscribe: PropTypes.array, }; SCCProductPickerModal.defaultProps = { id: '', taskId: '', reposToSubscribe: {}, }; export default SCCProductPickerModal;