'use strict';

var React = require('react');
var index = require('../../Checkbox/index.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

const CheckboxColumnHeaderCell = ({ onChange }) => {
  const _onChange = React.useCallback(
    (e) => {
      onChange(e.target.checked, true);
    },
    [onChange]
  );
  return /* @__PURE__ */ React__default.default.createElement(index, { style: { marginTop: "4px" }, onChange: _onChange });
};
const CheckboxColumnBodyCell = ({ data, column, index: index$1, onChange }) => {
  const value = data[index$1][column.key] === void 0 ? column.defaultValue : data[index$1][column.key];
  const _onChange = React.useCallback(
    (e) => {
      onChange(e.target.checked);
    },
    [onChange]
  );
  const defaultChecked = column.defaultValue;
  return /* @__PURE__ */ React__default.default.createElement(
    index,
    {
      checked: value,
      onChange: _onChange,
      defaultChecked
    }
  );
};

exports.CheckboxColumnBodyCell = CheckboxColumnBodyCell;
exports.CheckboxColumnHeaderCell = CheckboxColumnHeaderCell;
