import React from 'react'; import { useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import { Button, WizardFooter, WizardContextConsumer, Tooltip, Spinner, } from '@patternfly/react-core'; import { translate as __ } from 'foremanReact/common/I18n'; import { WIZARD_TITLES } from './JobWizardConstants'; import { selectIsSubmitting } from './JobWizardSelectors'; export const Footer = ({ canSubmit, onSave }) => { const isSubmitting = useSelector(selectIsSubmitting); return ( {({ activeStep, onNext, onBack, onClose, goToStepByName }) => { const isValid = activeStep && activeStep.enableNext !== undefined ? activeStep.enableNext : true; return ( <> {canSubmit ? __('Start job') : __('Fill all required fields in all the steps')} } > {canSubmit ? __('Skip to review step') : __( 'Fill all required fields in all the steps to start the job' )} } > {isSubmitting && (
)} ); }}
); }; Footer.propTypes = { canSubmit: PropTypes.bool.isRequired, onSave: PropTypes.func.isRequired, };