"use strict";

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

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

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

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

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

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

var _ = require("..");

var _templateObject;

var MobileMenuItemList = function MobileMenuItemList(_ref) {
  var items = _ref.items;
  var hideMobileDrawer = (0, _.useHideMobileDrawer)();

  var preventDefault = function preventDefault(e) {
    e.preventDefault();
  };

  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, items == null ? void 0 : items.map(function (menuItem) {
    var _ref2, _menuItem$tags;

    var link = (_ref2 = menuItem.slug || menuItem.linkUrl) == null ? void 0 : _ref2.trim();
    return /*#__PURE__*/_react["default"].createElement(Li, {
      key: 'Sub DropdownItem-' + link,
      className: menuItem == null ? void 0 : (_menuItem$tags = menuItem.tags) == null ? void 0 : _menuItem$tags.join(' ')
    }, /*#__PURE__*/_react["default"].createElement(_lib.Link, {
      href: link || '/',
      passHref: true
    }, /*#__PURE__*/_react["default"].createElement("a", {
      onClick: !link || link === '#' ? preventDefault : hideMobileDrawer
    }, menuItem == null ? void 0 : menuItem.name)));
  }));
};

exports.MobileMenuItemList = MobileMenuItemList;

var Li = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  width: 100%;\n  text-align: left;\n  line-height: 1.6;\n  font-size: 1.6rem;\n  color: ", ";\n\n  &.promotion,\n  &.red {\n    color: ", " !important;\n    opacity: 1 !important;\n  }\n\n  &.bold {\n    font-weight: bold;\n  }\n\n  &.black {\n    color: ", " !important;\n  }\n\n  &.space-top {\n    padding-top: 2.4rem;\n  }\n"])), function (props) {
  return props.theme.palette.hint;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.palette.discount;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.palette.primary;
});
//# sourceMappingURL=index.js.map