UNPKG

1.48 kBJavaScriptView Raw
1import _extends from "@babel/runtime/helpers/extends";
2import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3import React from 'react';
4import classNames from 'classnames';
5import { getPrefixCls } from '../configure';
6
7var Meta = function Meta(props) {
8 var customizePrefixCls = props.prefixCls,
9 className = props.className,
10 avatar = props.avatar,
11 title = props.title,
12 description = props.description,
13 others = _objectWithoutProperties(props, ["prefixCls", "className", "avatar", "title", "description"]);
14
15 var prefixCls = getPrefixCls('card', customizePrefixCls);
16 var classString = classNames("".concat(prefixCls, "-meta"), className);
17 var avatarDom = avatar ? React.createElement("div", {
18 className: "".concat(prefixCls, "-meta-avatar")
19 }, avatar) : null;
20 var titleDom = title ? React.createElement("div", {
21 className: "".concat(prefixCls, "-meta-title")
22 }, title) : null;
23 var descriptionDom = description ? React.createElement("div", {
24 className: "".concat(prefixCls, "-meta-description")
25 }, description) : null;
26 var MetaDetail = titleDom || descriptionDom ? React.createElement("div", {
27 className: "".concat(prefixCls, "-meta-detail")
28 }, titleDom, descriptionDom) : null;
29 return React.createElement("div", _extends({}, others, {
30 className: classString
31 }), avatarDom, MetaDetail);
32};
33
34Meta.displayName = 'CardMeta';
35export default Meta;
36//# sourceMappingURL=Meta.js.map