import React from 'react'; const CheckBoxList = ({ items, formData, handleChange, fieldName, label, icon: Icon, className, itemLabelFunc = (item) => item.name, labelAttenuated = () => false, horizontal = false // Ajouter l'option horizontal }) => { const handleCheckboxChange = (e) => { handleChange(e); }; return (
{items.map(item => { const isChecked = formData[fieldName].includes(parseInt(item.id)); const isAttenuated = labelAttenuated(item) && !isChecked; return (
{horizontal && ( )} {!horizontal && ( )}
); })}
); }; export default CheckBoxList;