import React from 'react';
import './ConfigurationItem.css';
import settings from '../../assets/settings';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons';
import {connect} from 'react-redux';
import {notifyInfo} from '../../redux/actions/error_actions';
const mapDispatchToProps = dispatch => {
return {
notifyInfo: (title, msg) => dispatch(notifyInfo(title, msg))
}
};
export default connect(null, mapDispatchToProps)(props => {
const handleChanged = (e) => {
const target = e.target;
if (target.type === 'checkbox') {
target.value = e.target.checked ? "true" : "false";
}
props.changed(target);
};
let infoDisplay;
if (settings[props.grouping] && settings[props.grouping][props.label]) {
const displayInfo = () => {
const description = settings[props.grouping][props.label];
props.notifyInfo(props.label, description);
};
infoDisplay = {displayInfo(); return false;}}>
| {infoDisplay} {props.label} | :{props.label} | }{data} |