forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressInteractiveFailure.tsx
More file actions
55 lines (52 loc) · 1.66 KB
/
ProgressInteractiveFailure.tsx
File metadata and controls
55 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { useState } from 'react';
import {
Progress,
ProgressMeasureLocation,
ProgressVariant,
Radio,
Checkbox,
Form,
FormGroup
} from '@patternfly/react-core';
export const ProgressInteractiveFailure: React.FunctionComponent = () => {
const [measureLocation, setMeasureLocation] = useState<ProgressMeasureLocation>(ProgressMeasureLocation.inside);
const [hideStatusIcon, setHideStatusIcon] = useState<boolean>(false);
const measureLocationOptions = [
{ value: ProgressMeasureLocation.inside, label: 'Inside' },
{ value: ProgressMeasureLocation.outside, label: 'Outside' },
{ value: ProgressMeasureLocation.top, label: 'Top' },
{ value: ProgressMeasureLocation.none, label: 'None' }
];
return (
<Form>
<FormGroup fieldId="measure-location" label="Measure location">
{measureLocationOptions.map((option) => (
<Radio
key={option.value}
id={`measure-location-${option.value}`}
name="measure-location"
label={option.label}
value={option.value}
isChecked={measureLocation === option.value}
onChange={() => setMeasureLocation(option.value)}
/>
))}
</FormGroup>
<FormGroup fieldId="hide-status-icon">
<Checkbox
id="hide-status-icon"
label="Hide status icon"
isChecked={hideStatusIcon}
onChange={(_, checked) => setHideStatusIcon(checked)}
/>
</FormGroup>
<Progress
value={33}
title="Title"
measureLocation={measureLocation}
variant={ProgressVariant.danger}
hideStatusIcon={hideStatusIcon}
/>
</Form>
);
};