import * as React from 'react'; import classNames from 'classnames'; export interface CardMetaProps { prefixCls?: string; style?: React.CSSProperties; className?: string; avatar?: React.ReactNode; title?: React.ReactNode; description?: React.ReactNode; } export default (props: CardMetaProps) => { const { prefixCls = 'ant-card', className, avatar, title, description, ...others } = props; const classString = classNames(`${prefixCls}-meta`, className); const avatarDom = avatar ?
{avatar}
: null; const titleDom = title ?
{title}
: null; const descriptionDom = description ?
{description}
: null; const MetaDetail = titleDom || descriptionDom ?
{titleDom} {descriptionDom}
: null; return (
{avatarDom} {MetaDetail}
); };