"use strict";

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

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

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

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

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

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

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

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

var _MobileMenuItemList = require("../MobileMenuItemList");

var _MobileBrandList = require("../MobileBrandList");

var _templateObject, _templateObject2;

var MobileBrandSection = function MobileBrandSection(_ref) {
  var data = _ref.data,
      handleClose = _ref.handleClose,
      onCloseStart = _ref.onCloseStart;

  var _useLocalLabels = (0, _lib.useLocalLabels)(),
      featuredBrands = _useLocalLabels.featuredBrands;

  var back = (0, _lib.useGlobalLabels)().buttons.back;
  return /*#__PURE__*/_react["default"].createElement(_AnimatedDrawer.AnimatedDrawer, {
    isLeft: null,
    handleClose: handleClose,
    onCloseStart: onCloseStart
  }, function (hideMenu) {
    var _data$sections;

    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, featuredBrands), /*#__PURE__*/_react["default"].createElement("ul", null, (_data$sections = data.sections) == null ? void 0 : _data$sections.map(function (section) {
      if (section.hideOnMobile) return null;
      return section.items.map(function (item) {
        return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
          key: "Item__" + item._id
        }, /*#__PURE__*/_react["default"].createElement(_MobileMenuItemList.MobileMenuItemList, {
          items: item.data.before
        }), /*#__PURE__*/_react["default"].createElement(_MobileBrandList.MobileBrandList, {
          brands: item.data.items
        }), /*#__PURE__*/_react["default"].createElement(_MobileMenuItemList.MobileMenuItemList, {
          items: item.data.after
        }));
      });
    })));
  });
};

exports.MobileBrandSection = MobileBrandSection;

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