"use strict";

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

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

exports.__esModule = true;
exports.DropdownItem = exports.MenuItemList = void 0;

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

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

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

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

var _templateObject, _templateObject2, _templateObject3;

var MenuItemList = function MenuItemList(_ref) {
  var items = _ref.items;

  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 _menuItem$tags;

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

exports.MenuItemList = MenuItemList;

var DropdownItem = _styledComponents["default"].a(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  font-size: 1.4rem;\n  line-height: 1.428571;\n  cursor: pointer;\n  color: ", ";\n  font-weight: 500;\n  margin-bottom: 6px;\n  text-align: left;\n  display: block;\n  text-decoration: none;\n\n  &.promotion,\n  &.red {\n    color: ", " !important;\n    opacity: 1 !important;\n  }\n\n  &.bold {\n    font-weight: bold;\n  }\n\n  ", "\n\n  ", "\n"])), function (_ref2) {
  var theme = _ref2.theme;
  return theme.palette.hint;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.palette.discount;
}, function (props) {
  return !props.isHeader && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])(["\n      &:hover {\n        color: ", ";\n        transition: color 0.2s;\n      }\n    "])), props.theme.palette.primary);
}, function (props) {
  return props.isHeader && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteralLoose2["default"])(["\n      margin-top: 14px;\n      margin-bottom: 14px;\n      color: ", ";\n      font-size: 1.6rem;\n    "])), props.theme.palette.primary);
});

exports.DropdownItem = DropdownItem;
//# sourceMappingURL=index.js.map