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

var _templateObject, _templateObject2;

import React from 'react';
import styled from 'styled-components';
import { Link, useListingConfig, useListingSlug, ListingTypesEnum } from '@sentecacommerce-theme/lib';
import { Typography } from '../../../Common';
export var SearchMeta = (_ref) => {
  var {
    data,
    total
  } = _ref;
  var slug = useListingSlug();
  var config = useListingConfig();
  if (config.type !== ListingTypesEnum.Search) return null;
  return /*#__PURE__*/React.createElement(React.Fragment, null, !(data != null && data.displayName) && /*#__PURE__*/React.createElement("span", {
    className: "d-flex flex-column"
  }, /*#__PURE__*/React.createElement(Title, null, "\u0422\u044A\u0440\u0441\u0435\u043D\u0435 \u043F\u043E ", slug, "\xA0"), (data == null ? void 0 : data.didYouMean) && /*#__PURE__*/React.createElement(Link, {
    href: "/search?q=" + (data == null ? void 0 : data.didYouMean),
    passHref: true
  }, /*#__PURE__*/React.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, "?"))));
};
var Title = styled(Typography).attrs({
  color: 'primary',
  variant: 4,
  as: 'h1',
  className: 'mr-auto'
})(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\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 = styled(Typography).attrs({
  color: 'primary',
  variant: 6,
  as: 'h2',
  className: 'mr-auto'
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n  cursor: pointer;\n  text-decoration: underline;\n  text-align: left;\n  color: ", ";\n\n  @media (max-width: ", ") {\n    user-select: none;\n  }\n"])), (_ref2) => {
  var {
    theme
  } = _ref2;
  return theme.palette.hint;
}, (_ref3) => {
  var {
    theme
  } = _ref3;
  return theme.breakpoints.md.max;
});
//# sourceMappingURL=index.js.map