-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParentSwitch.tsx
50 lines (46 loc) · 998 Bytes
/
ParentSwitch.tsx
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
import MultiToggle from "react-multi-toggle";
import React from "react";
import "react-multi-toggle/style.css";
import "./index.css";
interface IState {
options: any;
}
interface IProps {
parentSwitch: string;
onSelect(value: any): void;
}
class ParentSwitch extends React.Component<IProps, IState> {
constructor(props: any) {
super(props);
this.state = {
options: [
{
displayName: "Disabled",
value: "disabled",
optionClass: "red",
},
{
displayName: "Pending",
value: "pending",
optionClass: "grey",
},
{
displayName: "Enabled",
value: "enabled",
optionClass: "green",
},
],
};
}
render() {
const { options } = this.state;
return (
<MultiToggle
options={options}
selectedOption={this.props.parentSwitch}
onSelectOption={() => {}}
/>
);
}
}
export default ParentSwitch;