"use strict";

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

exports.__esModule = true;
exports.SearchMeta = 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 _Common = require("../../../Common");

var _templateObject, _templateObject2;

var SearchMeta = function SearchMeta(_ref) {
  var data = _ref.data,
      total = _ref.total;
  var slug = (0, _lib.useListingSlug)();
  var config = (0, _lib.useListingConfig)();
  if (config.type !== _lib.ListingTypesEnum.Search) return null;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !(data != null && data.displayName) && /*#__PURE__*/_react["default"].createElement("span", {
    className: "d-flex flex-column"
  }, /*#__PURE__*/_react["default"].createElement(Title, null, "\u0422\u044A\u0440\u0441\u0435\u043D\u0435 \u043F\u043E ", slug, "\xA0(", total, ")"), (data == null ? void 0 : data.didYouMean) && /*#__PURE__*/_react["default"].createElement(_lib.Link, {
    href: "/search?q=" + (data == null ? void 0 : data.didYouMean),
    passHref: true
  }, /*#__PURE__*/_react["default"].createElement(DidYouMeanTitle, null, "\u0412\u043C\u0435\u0441\u0442\u043E \u0442\u043E\u0432\u0430, \u0434\u0430 \u0441\u0435 \u0442\u044A\u0440\u0441\u0438 \u043Fo ", data.didYouMean, "?"))));
};

exports.SearchMeta = SearchMeta;
var Title = (0, _styledComponents["default"])(_Common.Typography).attrs({
  color: 'primary',
  variant: 4,
  as: 'h1',
  className: 'mr-auto'
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  text-align: left;\n  line-height: 1.3;\n\n  & span {\n    font-size: 1.6rem;\n    opacity: 0.5;\n    margin-bottom: 0.2rem;\n  }\n"])));
var DidYouMeanTitle = (0, _styledComponents["default"])(_Common.Typography).attrs({
  color: 'primary',
  variant: 6,
  as: 'h2',
  className: 'mr-auto'
})(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  cursor: pointer;\n  text-decoration: underline;\n  text-align: left;\n  color: ", ";\n\n  @media (max-width: ", ") {\n    user-select: none;\n  }\n"])), function (_ref2) {
  var theme = _ref2.theme;
  return theme.palette.hint;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.breakpoints.md.max;
});
//# sourceMappingURL=index.js.map