import classNames from 'classnames'; import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumer } from '../config-provider'; export interface CardMetaProps { prefixCls?: string; style?: React.CSSProperties; className?: string; avatar?: React.ReactNode; title?: React.ReactNode; description?: React.ReactNode; } const Meta: React.FC = props => ( {({ getPrefixCls }: ConfigConsumerProps) => { const { prefixCls: customizePrefixCls, className, avatar, title, description, ...others } = props; const prefixCls = getPrefixCls('card', customizePrefixCls); 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}
); }}
); export default Meta;