import React from 'react'; import classNames from 'classnames'; export interface CardProps { prefixCls?: string; title?: React.ReactNode; extra?: React.ReactNode; bordered?: boolean; bodyStyle?: React.CSSProperties; style?: React.CSSProperties; loading?: boolean; children?: any; id?: string; className?: string; } export default (props: CardProps) => { const { prefixCls = 'ant-card', className, extra, bodyStyle, title, loading, bordered = true, ...others, } = props; let children = props.children; const classString = classNames(prefixCls, className, { [`${prefixCls}-loading`]: loading, [`${prefixCls}-bordered`]: bordered, }); if (loading) { children = (

); } let head; if (!title) { head = null; } else { head = typeof title === 'string' ? (

{title}

) : (
{title}
); } return (
{head} {extra ?
{extra}
: null}
{children}
); };