mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-12 11:55:23 +08:00
28 lines
777 B
React
28 lines
777 B
React
|
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 } = this.props;
|
||
|
const itemClassName = classNames({
|
||
|
[`${prefixCls}-item`]: true,
|
||
|
[`${prefixCls}-item-last`]: last,
|
||
|
[`${prefixCls}-item-pending`]: pending,
|
||
|
});
|
||
|
return (
|
||
|
<li className={itemClassName}>
|
||
|
<div className={`${prefixCls}-item-tail`} />
|
||
|
<div className={`${prefixCls}-item-head ${prefixCls}-item-head-${color}`} />
|
||
|
<div className={`${prefixCls}-item-content`}>{children}</div>
|
||
|
</li>
|
||
|
);
|
||
|
}
|
||
|
}
|