import React from 'react';
let Timeline = React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-timeline'
};
},
render() {
let children = this.props.children;
return (
{React.Children.map(children, function (ele, idx) {
let np = {
timelineLast: idx === children.length - 1
};
return React.cloneElement(ele, np);
}, this)}
);
}
});
Timeline.Item = React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-timeline',
color: 'blue',
end: false
};
},
render() {
let props = this.props;
let prefixCls = props.prefixCls;
let color = props.color;
let end = props.end;
let endCls = end ? prefixCls + '-item-last' : '';
let last = end ? : null;
let lastLineShow = (props.timelineLast && !end) ? 'none' : 'block';
return (
{props.children}
{last}
);
}
});
export default Timeline;