"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.MenuMessageDataTids = exports.MenuMessage = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _react = _interopRequireWildcard(require("react"));

var _forwardRefAndName = require("../../lib/forwardRefAndName");
var _ResponsiveLayout = require("../../components/ResponsiveLayout");
var _Emotion = require("../../lib/theming/Emotion");
var _ThemeContext = require("../../lib/theming/ThemeContext");



var _MenuMessage = require("./MenuMessage.styles");var _excluded = ["children", "className", "size", "as"];







var MenuMessageDataTids = exports.MenuMessageDataTids = {
  root: 'MenuMessage__root'
};

var MenuMessage = exports.MenuMessage = (0, _forwardRefAndName.forwardRefAndName)(
  'MenuMessage',
  function (_ref, ref) {var _cx;var children = _ref.children,className = _ref.className,_ref$size = _ref.size,size = _ref$size === void 0 ? 'small' : _ref$size,_ref$as = _ref.as,Tag = _ref$as === void 0 ? 'p' : _ref$as,rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
    var _useResponsiveLayout = (0, _ResponsiveLayout.useResponsiveLayout)(),isMobile = _useResponsiveLayout.isMobile;

    var theme = (0, _react.useContext)(_ThemeContext.ThemeContext);

    var getMenuMessageSizeClassName = function getMenuMessageSizeClassName() {
      switch (size) {
        case 'large':
          return (0, _Emotion.cx)(_MenuMessage.styles.rootLarge(theme));
        case 'medium':
          return (0, _Emotion.cx)(_MenuMessage.styles.rootMedium(theme));
        case 'small':
        default:
          return (0, _Emotion.cx)(_MenuMessage.styles.rootSmall(theme));
      }
    };

    return /*#__PURE__*/(
      _react.default.createElement(Tag, (0, _extends2.default)({
        ref: ref,
        "data-tid": MenuMessageDataTids.root,
        className: (0, _Emotion.cx)(
          getMenuMessageSizeClassName(), (_cx = {}, _cx[

          _MenuMessage.styles.root(theme)] = true, _cx[
          _MenuMessage.styles.rootMobile(theme)] = isMobile, _cx),

          className
        ) },
      rest),

      children
      ));

  }
);