import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import { Button, TextInput, FormGroup, GridItem, Grid, EmptyState, EmptyStateIcon, EmptyStateVariant, EmptyStateBody, } from '@patternfly/react-core'; import { ExternalLinkAltIcon, RocketIcon } from '@patternfly/react-icons'; import { post } from 'foremanReact/redux/API'; import { translate as __ } from 'foremanReact/common/I18n'; import { INSIGHTS_SAVE_AND_SYNC_PATH } from '../InsightsCloudSyncConstants'; import { INSIGHTS_HITS_API_KEY } from './InsightsTable/InsightsTableConstants'; export const NoTokenEmptyState = () => { const [token, setToken] = useState(''); const dispatch = useDispatch(); const onSave = () => { dispatch( post({ key: INSIGHTS_HITS_API_KEY, url: INSIGHTS_SAVE_AND_SYNC_PATH, params: { value: token }, }) ); }; return (

{__(`Insights synchronization process is used to provide Insights recommendations output for hosts managed here`)}

{__( `To use recommendations please add a token to 'Red Hat Cloud token' setting here or in the settings page` )}
{__(`You can obtain a Red Hat API token here: `)} access.redhat.com


setToken(newValue)} aria-label="input-cloud-token" />
); };