Debian Codegraph @

node/@patternfly/react-core/src/components/Icon/examples/IconCustomProgress.tsx

raw
1 import { Fragment, useState } from 'react';
2 import { Icon, Spinner, Checkbox } from '@patternfly/react-core';
3 import RhUiCheckCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-check-circle-fill-icon';
4
5 export const IconProgress: React.FunctionComponent = () => {
6 const [isInProgress, setIsInProgress] = useState<boolean>(false);
7 return (
8 <Fragment>
9 <div style={{ marginBottom: '12px' }}>
10 <Checkbox
11 label="Toggle in progress state"
12 isChecked={isInProgress}
13 onChange={(_event, checked) => setIsInProgress(checked)}
14 aria-label="Set icon progress state"
15 id="toggle-icon-progress-custom"
16 name="toggle-icon-progress-custom"
17 />
18 </div>
19 <Icon isInProgress={isInProgress} progressIcon={<Spinner diameter="2em" aria-label="Loading..." />}>
20 <RhUiCheckCircleFillIcon />
21 </Icon>
22 </Fragment>
23 );
24 };