import React from 'react';
import { withNamespaces } from 'react-i18next';
import { FormGroup, FormControlLabel, Checkbox, FormLabel } from '@material-ui/core';
import translateLabel from "../translation";

function CheckboxLabels(props) {
  const [state, setState] = React.useState({
    checkedAcknowldege: false
  });

  const handleChange = event => {
    setState({ ...state,
      [event.target.name]: event.target.checked
    });
    props.onAcknowledgeClick(event.target.checked);
  };

  return /*#__PURE__*/React.createElement(FormGroup, {
    row: true
  }, /*#__PURE__*/React.createElement(FormLabel, {
    component: "legend",
    className: "acknowledgelabel Acklabel"
  }, translateLabel('ACKNOWLEDGE'), " "), /*#__PURE__*/React.createElement(FormControlLabel, {
    style: {
      marginRight: "0px"
    },
    control: /*#__PURE__*/React.createElement(Checkbox, {
      checked: state.checkedAcknowldege,
      onChange: handleChange,
      name: "checkedAcknowldege",
      style: {
        paddingRight: "0px"
      },
      color: "primary"
    }),
    label: translateLabel('ACKNOWLEDGELABE')
  }));
}

export default withNamespaces()(CheckboxLabels);