"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

exports.__esModule = true;
exports.MobileMenuSectionList = void 0;

var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));

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

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _lib = require("@sentecacommerce-theme/lib");

var _AnimatedDrawer = require("../AnimatedDrawer");

var _MobileSectionMenuItem = require("../MobileSectionMenuItem");

var _Common = require("../../../../Common");

var _templateObject, _templateObject2;

var MobileMenuSectionList = function MobileMenuSectionList(_ref) {
  var data = _ref.data,
      parentName = _ref.parentName,
      handleClose = _ref.handleClose,
      onCloseStart = _ref.onCloseStart;
  var back = (0, _lib.useGlobalLabels)().buttons.back;

  var _useState = (0, _react.useState)(null),
      slideLeft = _useState[0],
      setSlideLeft = _useState[1];

  return /*#__PURE__*/_react["default"].createElement(_AnimatedDrawer.AnimatedDrawer, {
    onCloseStart: onCloseStart,
    handleClose: handleClose,
    showCloseIcon: true,
    isLeft: slideLeft
  }, function (hideMenu) {
    return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(BackButton, {
      onClick: hideMenu
    }, /*#__PURE__*/_react["default"].createElement(_Common.ArrowLeft, null), " ", /*#__PURE__*/_react["default"].createElement("span", {
      className: "ml-3"
    }, back)), /*#__PURE__*/_react["default"].createElement(ParentName, null, parentName), /*#__PURE__*/_react["default"].createElement("ul", null, data == null ? void 0 : data.map(function (section) {
      return /*#__PURE__*/_react["default"].createElement(_MobileSectionMenuItem.MobileSectionMenuItem, {
        key: section._id,
        data: section,
        slideLeft: function slideLeft() {
          return setSlideLeft(true);
        },
        onCloseStart: function onCloseStart() {
          return setSlideLeft(false);
        },
        sectionName: parentName
      });
    })));
  });
};

exports.MobileMenuSectionList = MobileMenuSectionList;

var BackButton = _styledComponents["default"].button.attrs({
  className: 'd-flex align-items-center justify-content-start mb-4 pt-2'
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  line-height: 1;\n  padding: 0.8rem 0 0 0 !important;\n  height: auto !important;\n  min-height: 0 !important;\n  min-width: 0 !important;\n  width: 100% !important;\n  text-align: left;\n\n  & span {\n    line-height: 0;\n    margin-bottom: -0.2rem;\n    font-weight: bold;\n    font-size: 1.4rem;\n  }\n"])));

var ParentName = _styledComponents["default"].div.attrs({
  className: 'pb-3 pt-3'
})(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  font-size: 2.4rem;\n  line-height: 1.6667;\n"])));
//# sourceMappingURL=index.js.map