import React from 'react';
import PropTypes from 'prop-types';
class LoadStatus extends React.Component {
render() {
return (
<div style={{
fontSize: typeof this.props.size === 'number' ? `${this.props.size}px` : this.props.size,
color: this.props.color
}}>
<i className={`fa ${this.props.icon}${this.props.spins ? ' fa-spin' : ''}`} />
{this.props.message ? (<span> {this.props.message}</span>) : ''}
</div>
);
}
}
LoadStatus.propTypes = {
message: PropTypes.string,
icon: PropTypes.string,
spins: PropTypes.bool,
color: PropTypes.string,
size: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
};
LoadStatus.defaultProps = {
message: '',
icon: 'fa-refresh',
spins: false,
size: '1em',
color: '#000000'
};
export default LoadStatus;
|