antd
Version:
An enterprise-class UI design language and React-based implementation
71 lines (58 loc) • 2.49 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _react = require('react');
var React = _interopRequireWildcard(_react);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
}if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
}return t;
};
exports['default'] = function (props) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === undefined ? 'ant-card' : _props$prefixCls,
className = props.className,
avatar = props.avatar,
title = props.title,
description = props.description,
others = __rest(props, ["prefixCls", "className", "avatar", "title", "description"]);
var classString = (0, _classnames2['default'])(prefixCls + '-meta', className);
var avatarDom = avatar ? React.createElement(
'div',
{ className: prefixCls + '-meta-avatar' },
avatar
) : null;
var titleDom = title ? React.createElement(
'div',
{ className: prefixCls + '-meta-title' },
title
) : null;
var descriptionDom = description ? React.createElement(
'div',
{ className: prefixCls + '-meta-description' },
description
) : null;
var MetaDetail = titleDom || descriptionDom ? React.createElement(
'div',
{ className: prefixCls + '-meta-detail' },
titleDom,
descriptionDom
) : null;
return React.createElement(
'div',
(0, _extends3['default'])({}, others, { className: classString }),
avatarDom,
MetaDetail
);
};
module.exports = exports['default'];
;