1 | import _extends from "@babel/runtime/helpers/extends";
|
2 | import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3 | import React from 'react';
|
4 | import classNames from 'classnames';
|
5 | import { getPrefixCls } from '../configure';
|
6 |
|
7 | var 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 |
|
34 | Meta.displayName = 'CardMeta';
|
35 | export default Meta;
|
36 |
|