import React, { useContext } from 'react'; import { translate as __ } from 'foremanReact/common/I18n'; import { Alert, ClipboardCopy, Grid, GridItem, Form, FormGroup, FormSelect, FormSelectOption, Tile, } from '@patternfly/react-core'; import { FormattedMessage } from 'react-intl'; import ACSCreateContext from '../ACSCreateContext'; import WizardHeader from '../../../ContentViews/components/WizardHeader'; const SelectSource = () => { const { acsType, setAcsType, contentType, setContentType, setAuthentication, } = useContext(ACSCreateContext); const onSelect = (event) => { setAcsType(event.currentTarget.id); if (event.currentTarget.id === 'rhui') { setAuthentication('content_credentials'); } else { setAuthentication(''); } }; const onKeyDown = (event) => { if (event.key === ' ' || event.key === 'Enter') { event.preventDefault(); setAcsType(event.currentTarget.id); } }; const typeOptions = [{ value: 'yum', label: __('Yum') }]; if (acsType !== 'rhui') { typeOptions.push({ value: 'file', label: __('File') }); } return ( <>
{__('Define repositories structured under a common web or filesystem path.')} {__('Sync smart proxy content directly from upstream repositories by selecting the desired products.')} {__('Define RHUI repository paths with guided steps.')} { setContentType(value); }} aria-label="FormSelect Input" > { typeOptions.map(option => ( )) } {acsType === 'rhui' && <> rhui-manager client cert --name rhui-acs-certs --days 365 --dir /root --repo_label rhui-repo-1,rhui-repo-2 {__('Create content credentials with the generated SSL certificate and key.')} } ); }; export default SelectSource;