import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["prefixCls", "className", "avatar", "title", "description"];
import React, { memo, useContext } from 'react';
import classNames from 'classnames';
import ConfigContext from '../config-provider/ConfigContext';

var CardMeta = function CardMeta(props) {
  var customizePrefixCls = props.prefixCls,
      className = props.className,
      avatar = props.avatar,
      title = props.title,
      description = props.description,
      others = _objectWithoutProperties(props, _excluded);

  var _useContext = useContext(ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

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

CardMeta.displayName = 'CardMeta';
export default /*#__PURE__*/memo(CardMeta);
//# sourceMappingURL=Meta.js.map
