mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 11:58:41 +08:00
23 lines
677 B
JavaScript
23 lines
677 B
JavaScript
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
export default props => {
|
|
const { prefixCls = 'ant-card', className, children, extra, bodyStyle, title, ...other } = props;
|
|
const classString = classNames({
|
|
[prefixCls]: true,
|
|
[className]: !!className,
|
|
});
|
|
const head = title ? (
|
|
<div className={`${prefixCls}-head`}>
|
|
<h3 className={`${prefixCls}-head-title`}>{title}</h3>
|
|
</div>
|
|
) : null;
|
|
return (
|
|
<div {...other} className={classString}>
|
|
{head}
|
|
{extra ? <div className={`${prefixCls}-extra`}>{extra}</div> : null}
|
|
<div className={`${prefixCls}-body`} style={bodyStyle}>{children}</div>
|
|
</div>
|
|
);
|
|
};
|