File size: 997 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import React, { useState } from "react";
import './../CSS/checkbox.css';

const CheckBox = ({ categories, handleFilters }) => {
    // eslint-disable-next-line
    const [value, setValue] = useState(0);

    const handleChange = event => {
        handleFilters(event.target.value);
        setValue(event.target.value);
    };

    return categories.map((c, i) => (
        <div className="col-md-2 col-sm-4 col-xs-4" style={{height:"max-content"}}>
        <div key={i} className="category-toolbar form-check form-check-inline my-2 w-100 bg-success rounded border">
        <label className="form-check-label py-2 d-inline rounded shadow-lg font-weight-bold text-white w-100 text-center">
            <input
                onChange={handleChange}
                value={`${c._id}`}
                name={c}
                type="radio"
                className="mr-2 ml-4"
            />
            {c.name}
        </label>
        </div>
        </div>
    ));
};

export default CheckBox;