"use strict";

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

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

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

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

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

var _classnames = _interopRequireDefault(require("classnames"));

var _ConfigContext = _interopRequireDefault(require("../config-provider/ConfigContext"));

var _excluded = ["prefixCls", "className", "avatar", "title", "description"];

var CardMeta = function CardMeta(props) {
  var customizePrefixCls = props.prefixCls,
      className = props.className,
      avatar = props.avatar,
      title = props.title,
      description = props.description,
      others = (0, _objectWithoutProperties2["default"])(props, _excluded);

  var _useContext = (0, _react.useContext)(_ConfigContext["default"]),
      getPrefixCls = _useContext.getPrefixCls;

  var prefixCls = getPrefixCls('card', customizePrefixCls);
  var classString = (0, _classnames["default"])("".concat(prefixCls, "-meta"), className);
  var avatarDom = avatar ? /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefixCls, "-meta-avatar")
  }, avatar) : null;
  var titleDom = title ? /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefixCls, "-meta-title")
  }, title) : null;
  var descriptionDom = description ? /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefixCls, "-meta-description")
  }, description) : null;
  var MetaDetail = titleDom || descriptionDom ? /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefixCls, "-meta-detail")
  }, titleDom, descriptionDom) : null;
  return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, others, {
    className: classString
  }), avatarDom, MetaDetail);
};

CardMeta.displayName = 'CardMeta';

var _default = /*#__PURE__*/(0, _react.memo)(CardMeta);

exports["default"] = _default;
//# sourceMappingURL=Meta.js.map
