import React from 'react'; import { Card, Spin } from 'antd'; import classNames from 'classnames'; import styles from './index.less'; const renderTotal = (total) => { let totalDom; switch (typeof total) { case undefined: totalDom = null; break; case 'function': totalDom =
{total()}
; break; default: totalDom =
{total}
; } return totalDom; }; const ChartCard = ({ loading = false, contentHeight, title, avatar, action, total, footer, children, ...rest }) => { const content = (
{avatar}
{title} {action}
{renderTotal(total)}
{children && (
{children}
)} {footer && (
{footer}
)}
); return ( { {content} } ); }; export default ChartCard;