import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose";

var _templateObject, _templateObject2, _templateObject3;

import React from 'react';
import styled, { css } from 'styled-components';
import { Link } from '@sentecacommerce-theme/lib';
export var MenuItemList = (_ref) => {
  var {
    items
  } = _ref;

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

  return /*#__PURE__*/React.createElement(React.Fragment, null, items == null ? void 0 : items.map(menuItem => {
    var _menuItem$tags;

    var link = menuItem.slug || menuItem.linkUrl;
    return /*#__PURE__*/React.createElement(Link, {
      key: 'Sub DropdownItem-' + link,
      href: link || '/',
      passHref: true
    }, /*#__PURE__*/React.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));
  }));
};
export var DropdownItem = styled.a(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\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"])), (_ref2) => {
  var {
    theme
  } = _ref2;
  return theme.palette.hint;
}, (_ref3) => {
  var {
    theme
  } = _ref3;
  return theme.palette.discount;
}, props => !props.isHeader && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n      &:hover {\n        color: ", ";\n        transition: color 0.2s;\n      }\n    "])), props.theme.palette.primary), props => props.isHeader && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n      margin-top: 14px;\n      margin-bottom: 14px;\n      color: ", ";\n      font-size: 1.6rem;\n    "])), props.theme.palette.primary));
//# sourceMappingURL=index.js.map