ant-design/components/timeline/TimelineItem.jsx
2016-04-18 16:58:46 +08:00

29 lines
847 B
JavaScript

import React from 'react';
import classNames from 'classnames';
export default class TimelineItem extends React.Component {
static defaultProps = {
prefixCls: 'ant-timeline',
color: 'blue',
last: false,
pending: false,
}
render() {
const { prefixCls, color, last, children, pending, className, ...restProps } = this.props;
const itemClassName = classNames({
[`${prefixCls}-item`]: true,
[`${prefixCls}-item-last`]: last,
[`${prefixCls}-item-pending`]: pending,
[className]: className,
});
return (
<li {...restProps} className={itemClassName}>
<div className={`${prefixCls}-item-tail`} />
<div className={`${prefixCls}-item-head ${prefixCls}-item-head-${color}`} />
<div className={`${prefixCls}-item-content`}>{children}</div>
</li>
);
}
}