UNPKG

acud

Version:

acg react 组件库

52 lines • 2.38 kB
import _extends from "@babel/runtime/helpers/esm/extends"; /** * @file card/Meta * @author chenyaqiu */ var __rest = this && this.__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 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import * as React from 'react'; import classNames from 'classnames'; import { ConfigConsumer } from '../config-provider'; import { getAction } from './Card'; ; var Meta = function Meta(props) { return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) { var getPrefixCls = _ref.getPrefixCls; var customizePrefixCls = props.prefixCls, className = props.className, title = props.title, content = props.content, description = props.description, actions = props.actions, others = __rest(props, ["prefixCls", "className", "title", "content", "description", "actions"]); var prefixCls = getPrefixCls('card', customizePrefixCls); var classString = classNames("".concat(prefixCls, "-meta-wrap"), className); var titleDom = title ? /*#__PURE__*/React.createElement("div", { className: "".concat(prefixCls, "-meta-title") }, title) : null; var contentDom = content ? /*#__PURE__*/React.createElement("div", { className: "".concat(prefixCls, "-meta-content-detail") }, content) : null; var MetaContent = titleDom || contentDom ? /*#__PURE__*/React.createElement("div", { className: "".concat(prefixCls, "-meta-content") }, titleDom, contentDom) : null; var MetaActions = actions && actions.length ? /*#__PURE__*/React.createElement("ul", { className: "".concat(prefixCls, "-meta-footer-actions") }, getAction(actions)) : null; return /*#__PURE__*/React.createElement("div", _extends({ className: classString }, others), MetaContent, /*#__PURE__*/React.createElement("div", { className: "".concat(prefixCls, "-meta-footer") }, /*#__PURE__*/React.createElement("div", { className: "".concat(prefixCls, "-meta-footer-desc") }, description), MetaActions)); }); }; export default Meta;