"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TopologySelectorModalPageView = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _TopologySelectorModal = require("../../../components/TopologySelectorModal/TopologySelectorModal");

var _jsxRuntime = require("react/jsx-runtime");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TopologySelectorModalPageView = function TopologySelectorModalPageView(_ref) {
  var modal = _ref.modal,
      setModal = _ref.setModal,
      topologies = _ref.topologies;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
      type: "button",
      className: "py-3 px-6 bg-dark-blue rounded-6px text-white mb-4",
      onClick: function onClick() {
        setModal(true);
      },
      children: "Open Modal"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TopologySelectorModal.TopologySelectorModal, {
      handleModalClose: function handleModalClose() {
        return setModal(false);
      },
      isOpen: modal,
      topologies: topologies,
      title: "Add Card",
      submitButtonTitle: "Add",
      onSubmit: function onSubmit(data) {
        // eslint-disable-next-line no-console
        console.log("array of checked cards ids:", data);
        setModal(false);
      },
      defaultChecked: [topologies[0].id]
    })]
  });
};

exports.TopologySelectorModalPageView = TopologySelectorModalPageView;
TopologySelectorModalPageView.propTypes = {
  modal: _propTypes.default.bool.isRequired,
  setModal: _propTypes.default.func.isRequired,
  // eslint-disable-next-line react/forbid-prop-types
  topologies: _propTypes.default.array.isRequired
};