import React, { useMemo } from "react";
import { EyeOutlined } from "@ant-design/icons";
import { Popover } from "antd";
import PopoverContent from "./PopoverContent";
import ButtonIcon from "../ButtonIcon";
var ColumnsSetting = function ColumnsSetting(props) {
  var value = props.value,
    onChange = props.onChange;
  var content = useMemo(function () {
    return /*#__PURE__*/React.createElement(PopoverContent, {
      value: value,
      onChange: onChange
    });
  }, [value, onChange]);
  return /*#__PURE__*/React.createElement(Popover, {
    content: content,
    arrow: false,
    placement: "bottomRight",
    trigger: "click"
  }, /*#__PURE__*/React.createElement(ButtonIcon, {
    isActive: !!(value !== null && value !== void 0 && value.filter(function (item) {
      return !item.isShow;
    }).length)
  }, /*#__PURE__*/React.createElement(EyeOutlined, {
    style: {
      cursor: "pointer",
      fontSize: 18
    }
  })));
};
export default ColumnsSetting;