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 (
<>