import React from 'react'; import { EmptyState, EmptyStateHeader, EmptyStateFooter, EmptyStateBody, EmptyStateActions, EmptyStateIcon, Progress, Button, Wizard, WizardStep } from '@breakaway/preact-core'; import CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon'; interface ValidationProgressProps { onClose(): void; } const ValidationProgress: React.FunctionComponent = ({ onClose }) => { const [percentValidated, setPercentValidated] = React.useState(0); const tick = React.useCallback(() => { if (percentValidated < 100) { setPercentValidated((prevValue) => prevValue + 20); } }, [percentValidated]); React.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] = React.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 ); };