import React from 'react';
import { Form } from 'react-bootstrap';
import translateLabel from "../../translation";
const CheckBox = ({ name, id, value, label, type, isValid, options, onChange }) => (
    <div>
        <Form.Group controlId={id}>
            <Form.Label>{label}</Form.Label>
            {options.map((data, index) => (
               <div key={`custom-inline-${data.text}`} className="mb-3">
                    <Form.Check
                        type={type}
                        name={name}
                        label={translateLabel(data.text)}
                        value={data.value}
                        checked={data.checked}
                        id={id + index + 1}
                        isValid={isValid}
                        onChange={onChange}
                    />
                </div>
            ))}
        </Form.Group>
    </div>
 );
 
 export default CheckBox;