import React from 'react'; import { Radio, Content, Form, Title, FormGroup, TextInput, Gallery, GalleryItem, HelperText, HelperTextItem, Button, } from '@patternfly/react-core'; import { ExternalLinkAltIcon } from '@patternfly/react-icons'; import { AwsAccountId } from './AwsAccountId'; import { AwsSourcesSelect } from './AwsSourcesSelect'; import { useAppDispatch, useAppSelector } from '../../../../../store/hooks'; import { changeAwsAccountId, changeAwsShareMethod, changeAwsSourceId, selectAwsAccountId, selectAwsShareMethod, } from '../../../../../store/wizardSlice'; import { ValidatedInput } from '../../../ValidatedInput'; import { isAwsAccountIdValid } from '../../../validators'; export type AwsShareMethod = 'manual' | 'sources'; const SourcesButton = () => { return ( ); }; const Aws = () => { const dispatch = useAppDispatch(); const shareMethod = useAppSelector(selectAwsShareMethod); const shareWithAccount = useAppSelector(selectAwsAccountId); return (
Target environment - Amazon Web Services Your image will be uploaded to AWS and shared with the account you provide below. The shared image will expire within 14 days. To permanently access the image, copy the image, which will be shared to your account by Red Hat, to your own AWS account. { dispatch(changeAwsSourceId(undefined)); dispatch(changeAwsAccountId('')); dispatch(changeAwsShareMethod('sources')); }} autoFocus /> { dispatch(changeAwsSourceId(undefined)); dispatch(changeAwsAccountId('')); dispatch(changeAwsShareMethod('manual')); }} /> {shareMethod === 'sources' && ( <> Images are built in the default region but can be copied to other regions later. )} {shareMethod === 'manual' && ( <> dispatch(changeAwsAccountId(value))} helperText="Should be 12 characters long." /> )} ); }; export default Aws;