import React from 'react'; import Animate from 'rc-animate'; import Icon from '../icon'; const prefixCls = 'ant-upload'; import { Line } from '../progress'; import classNames from 'classnames'; export default React.createClass({ getDefaultProps() { return { listType: 'text', // or picture items: [], progressAttr: { strokeWidth: 3, showInfo: false } }; }, handleClose(file) { this.props.onRemove(file); }, render() { let list = this.props.items.map((file) => { let progress; let icon = ; if (this.props.listType === 'picture') { icon = (file.status === 'uploading' || !file.url) ? : {file.name}; } if (file.status === 'uploading') { progress =
; } const infoUploadingClass = classNames({ [`${prefixCls}-list-item`]: true, [`${prefixCls}-list-item-${file.status}`]: true, }); return (
{icon} {file.name}
{ progress }
); }); const listClassNames = classNames({ [`${prefixCls}-list`]: true, [`${prefixCls}-list-${this.props.listType}`]: true, }); return
{list}
; } });