import { useCallback, useEffect, useState } from 'react'; import { EmptyState, EmptyStateFooter, EmptyStateBody, EmptyStateActions, Progress, Button, Wizard, WizardStep } from '@patternfly/react-core'; import CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon'; import layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye'; interface ValidationProgressProps { onClose(): void; } const ValidationProgress: React.FunctionComponent = ({ onClose }) => { const [percentValidated, setPercentValidated] = useState(0); const tick = useCallback(() => { if (percentValidated < 100) { setPercentValidated((prevValue) => prevValue + 20); } }, [percentValidated]); useEffect(() => { const interval = setInterval(() => tick(), 1000); return () => { clearInterval(interval); }; }, [tick]); return (
Description can be used to further elaborate on the validation step, or give the user a better idea of how long the process will take.
); }; export const WizardWithSubmitProgress: React.FunctionComponent = () => { const [isSubmitted, setIsSubmitted] = useState(false); // eslint-disable-next-line no-console const onClose = () => console.log('Some close action occurs here.'); if (isSubmitted) { return ; } return ( Step 1 content Step 2 content setIsSubmitted(true) }} > Review step content ); };