import React from 'react'; import { Alert, Spinner, Content, ContentVariants, } from '@patternfly/react-core'; import { Button, Popover } from '@patternfly/react-core'; import { HelpIcon } from '@patternfly/react-icons'; import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table'; import { useAppSelector } from '../../../../store/hooks'; import { useShowActivationKeyQuery } from '../../../../store/rhsmApi'; import { selectActivationKey } from '../../../../store/wizardSlice'; const ActivationKeyInformation = (): JSX.Element => { const activationKey = useAppSelector(selectActivationKey); const { data: activationKeyInfo, isFetching: isFetchingActivationKeyInfo, isSuccess: isSuccessActivationKeyInfo, isError: isErrorActivationKeyInfo, } = useShowActivationKeyQuery( { name: activationKey! }, { skip: !activationKey, } ); return ( <> {isFetchingActivationKeyInfo && } {isSuccessActivationKeyInfo && ( Name: {activationKey} Role: {activationKeyInfo?.body?.role || 'Not defined'} SLA: {activationKeyInfo?.body?.serviceLevel || 'Not defined'} Usage: {activationKeyInfo?.body?.usage || 'Not defined'} Additional repositories: The core repositories for your operating system version are always enabled and do not need to be explicitly added to the activation key. } > ) : ( 'None' )} )} {isErrorActivationKeyInfo && ( Name: {activationKey}
Information about the activation key cannot be loaded. Please check the key was not removed and try again later.
)} ); }; export default ActivationKeyInformation;