import React, { useState } from 'react'; import { DescriptionList, DescriptionListTerm, DescriptionListGroup, DescriptionListDescription, List, ListItem, Tabs, Tab, TabTitleText, Text, TextContent, TextVariants, TextList, TextListVariants, TextListItem, TextListItemVariants } from '@patternfly/react-core'; import useFormApi from '@data-driven-forms/react-form-renderer/use-form-api'; import { releaseValues } from '../steps/imageOutput'; import { registerValues } from '../steps/registration'; import { googleAccType } from '../steps/googleCloud'; const ReviewStep = () => { const [ activeTabKey, setActiveTabKey ] = useState(0); const { getState } = useFormApi(); const handleTabClick = (event, tabIndex) => { setActiveTabKey(tabIndex); }; return ( <> Review the information and click "Create image" to create the image using the following criteria. Release {releaseValues?.[getState()?.values?.release]} Target environment } data-testid='tab-target'> {getState()?.values?.['target-environment']?.aws && }> Amazon Web Services Account ID {getState()?.values?.['aws-account-id']} } {getState()?.values?.['target-environment']?.google && }> Google Cloud Platform {googleAccType?.[getState()?.values?.['google-account-type']]} {getState()?.values?.['google-email'] || getState()?.values?.['google-domain']} } {getState()?.values?.['target-environment']?.azure && }> Microsoft Azure Subscription ID {getState()?.values?.['azure-subscription-id']} Tenant ID {getState()?.values?.['azure-tenant-id']} Resource group {getState()?.values?.['azure-resource-group']} } Registration } data-testid='tab-registration'> {getState()?.values?.['register-system'] === 'register-later-radio-button' && Subscription Register the system later } {getState()?.values?.['register-system'] === 'subscribe-now-radio' && getState()?.values?.release.includes('rhel') && Subscription {getState()?.values?.['register-system'] === 'subscribe-now-radio' ? 'Register the system on first boot' : registerValues?.[getState()?.values?.['register-system']?.title] } Activation key {getState()?.values?.['subscription-activation']} } System configuration } data-testid='tab-system'> Packages Chosen {getState()?.values?.['selected-packages']?.length || 0} ); }; export default ReviewStep;