import React__default, { useCallback } from 'react';
import Checkbox from '../../Checkbox/index.js';

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

export { CheckboxColumnBodyCell, CheckboxColumnHeaderCell };
