-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheckBoxList.js
31 lines (29 loc) · 959 Bytes
/
CheckBoxList.js
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
import React from 'react';
import CheckBox from './CheckBox';
export default function CheckBoxList ({options, isCheckedAll, onCheck}) {
const checkBoxOptions = (
<div className="checkbox-list">
{options.map((option, index) => {
return (
<CheckBox
key={index}
name={option.name}
value={option.value}
tick={option.checked}
onCheck={(e) => onCheck(option.value, e.target.checked)} />
);
})}
</div>
);
return (
<div className="checkbox-list">
<CheckBox
name="select-all"
value="ALL"
tick={isCheckedAll}
onCheck={(e) => onCheck('all', e.target.checked)}
/>
{checkBoxOptions}
</div>
);
}