"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _baseModal = _interopRequireDefault(require("../../molecule/base-modal"));
var _listItems = _interopRequireDefault(require("../list-items"));
var _multiFilterPanel = _interopRequireDefault(require("../../molecule/multi-filter-panel"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _colors = require("../../variables/colors");
var _style = _interopRequireDefault(require("./style.css"));
var _types = _interopRequireDefault(require("./types"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
const ContentSkillModal = props => {
  const {
    contentList,
    filters,
    modal
  } = props;
  const {
    isOpen,
    onCancel,
    onConfirm,
    onClose
  } = modal;
  const handleCancel = (0, _react.useCallback)(() => {
    onCancel();
  }, [onCancel]);
  const handleClose = (0, _react.useCallback)(() => {
    onClose();
  }, [onClose]);
  const headerIcon = {
    name: 'circle-plus',
    color: _colors.COLORS.primary_600,
    backgroundColor: _colors.COLORS.primary_100
  };
  const footer = (0, _react.useMemo)(() => ({
    cancelButton: {
      onCancel: handleCancel,
      label: 'Cancel'
    },
    confirmButton: {
      onConfirm,
      label: 'Add',
      iconName: 'plus',
      disabled: false,
      color: _colors.COLORS.cm_primary_blue
    }
  }), [handleCancel, onConfirm]);
  const baseModal = {
    title: 'Add content',
    description: 'Add courses, video, interactive and more to this skill',
    headerIcon,
    footer,
    isOpen,
    onClose: handleClose,
    customStyle: {
      padding: 0,
      height: '60vh',
      overflow: 'hidden'
    }
  };
  if (!isOpen) return null;
  return /*#__PURE__*/_react.default.createElement(_baseModal.default, baseModal, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.container
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.containerList
  }, /*#__PURE__*/_react.default.createElement(_listItems.default, contentList)), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.filtersContainer
  }, /*#__PURE__*/_react.default.createElement(_multiFilterPanel.default, filters))));
};
ContentSkillModal.contextTypes = {
  translate: _provider.default.childContextTypes.translate
};
ContentSkillModal.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
var _default = exports.default = ContentSkillModal;
//# sourceMappingURL=index.js.map