2020-03-27 13:59:38 -07:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2020-06-07 09:25:48 -07:00
|
|
|
import { injectIntl } from 'react-intl';
|
2020-03-27 13:59:38 -07:00
|
|
|
import classNames from 'classnames';
|
|
|
|
|
2020-06-07 09:25:48 -07:00
|
|
|
export default @injectIntl
|
|
|
|
class TimelineQueueButtonHeader extends React.PureComponent {
|
2020-04-14 11:44:40 -07:00
|
|
|
|
2020-03-27 13:59:38 -07:00
|
|
|
static propTypes = {
|
|
|
|
onClick: PropTypes.func.isRequired,
|
|
|
|
count: PropTypes.number,
|
2020-06-07 09:25:48 -07:00
|
|
|
message: PropTypes.object.isRequired,
|
|
|
|
intl: PropTypes.object.isRequired,
|
2020-03-27 13:59:38 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
count: 0,
|
|
|
|
};
|
|
|
|
|
2020-04-14 14:47:35 -07:00
|
|
|
render() {
|
2020-06-07 09:25:48 -07:00
|
|
|
const { count, message, onClick, intl } = this.props;
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
const classes = classNames('timeline-queue-header', {
|
2020-04-14 11:44:40 -07:00
|
|
|
'hidden': (count <= 0),
|
2020-03-27 13:59:38 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={classes}>
|
|
|
|
<a className='timeline-queue-header__btn' onClick={onClick}>
|
2020-06-07 09:25:48 -07:00
|
|
|
{(count > 0) && intl.formatMessage(message, { count })}
|
2020-03-27 13:59:38 -07:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2020-04-14 11:44:40 -07:00
|
|
|
|
2020-03-27 13:59:38 -07:00
|
|
|
}
|