"use strict";

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

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

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

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

var _link = _interopRequireDefault(require("next/link"));

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

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

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

var _templateObject, _templateObject2;

var SubFooterList = function SubFooterList(_ref) {
  var data = _ref.data;

  var _useCookies = (0, _lib.useCookies)(),
      deleteCookies = _useCookies.deleteCookies;

  var handleClick = function handleClick() {
    deleteCookies();
  };

  return /*#__PURE__*/_react["default"].createElement(Container, null, data.map(function (element) {
    var key = (element == null ? void 0 : element.url) + "-" + (element == null ? void 0 : element.label);

    if (element != null && element.url) {
      return /*#__PURE__*/_react["default"].createElement(_link["default"], {
        prefetch: false,
        key: key,
        href: element.url
      }, /*#__PURE__*/_react["default"].createElement(Item, null, element.label));
    }

    if (element != null && element.isCookies) {
      return /*#__PURE__*/_react["default"].createElement(Item, {
        key: key,
        onClick: handleClick
      }, element.label);
    }

    return /*#__PURE__*/_react["default"].createElement(Item, {
      key: key
    }, element.label);
  }));
};

exports.SubFooterList = SubFooterList;

var Container = _styledComponents["default"].ul(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  list-style: none;\n\n  @media (min-width: ", ") {\n    display: flex;\n    margin: 0 -15px;\n    flex-wrap: wrap;\n    justify-content: flex-end;\n  }\n"])), function (_ref2) {
  var theme = _ref2.theme;
  return theme.breakpoints.md.min;
});

var Item = (0, _styledComponents["default"])(_Common.Typography).attrs({
  as: 'li',
  variant: 7,
  className: 'mb-3 mb-md-0'
})(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  color: ", ";\n  cursor: pointer;\n  transition: color 0.15s ease;\n  width: max-content;\n\n  &:hover {\n    color: ", ";\n  }\n\n  @media (min-width: ", ") {\n    padding: 0 15px;\n  }\n"])), function (_ref3) {
  var theme = _ref3.theme;
  return theme.palette.grey;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.palette.secondary;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.breakpoints.md.min;
});
//# sourceMappingURL=index.js.map