import React from 'react';
import { Checkbox } from 'antd';
import { mealSections } from '../staticData/index';

const MealCheckbox = props => {
  const onChange = e => {
    props.onChange(props.field);
    props.changeType(e);
  };
  return (
    <Checkbox
      onChange={onChange}
      checked={props.meals[props.field]}
      id={props.field}
      label={mealSections[props.field]}
    >
      {mealSections[props.field]}
    </Checkbox>
  );
};

export default MealCheckbox;
