import * as React from 'react'; import classNames from 'classnames'; import omit from 'omit.js'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; export interface TimeLineItemProps { prefixCls?: string; className?: string; color?: string; dot?: React.ReactNode; pending?: boolean; position?: string; style?: React.CSSProperties; } const TimelineItem: React.SFC = props => ( {({ getPrefixCls }: ConfigConsumerProps) => { const { prefixCls: customizePrefixCls, className, color = '', children, pending, dot, ...restProps } = props; const prefixCls = getPrefixCls('timeline', customizePrefixCls); const itemClassName = classNames( { [`${prefixCls}-item`]: true, [`${prefixCls}-item-pending`]: pending, }, className, ); const dotClassName = classNames({ [`${prefixCls}-item-head`]: true, [`${prefixCls}-item-head-custom`]: dot, [`${prefixCls}-item-head-${color}`]: true, }); return (
  • {dot}
    {children}
  • ); }}
    ); TimelineItem.defaultProps = { color: 'blue', pending: false, position: '', }; export default TimelineItem;