// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import Constants from '../utils/constants.jsx';
import * as Utils from '../utils/utils.jsx';
import {FormattedRelative, FormattedDate} from 'mm-intl';
var Tooltip = ReactBootstrap.Tooltip;
var OverlayTrigger = ReactBootstrap.OverlayTrigger;
export default class TimeSince extends React.Component {
componentDidMount() {
this.intervalId = setInterval(() => {
this.forceUpdate();
}, Constants.TIME_SINCE_UPDATE_INTERVAL);
}
componentWillUnmount() {
clearInterval(this.intervalId);
}
render() {
if (this.props.sameUser) {
return (
);
}
const tooltip = (
);
return (
);
}
}
TimeSince.defaultProps = {
eventTime: 0,
sameUser: false
};
TimeSince.propTypes = {
eventTime: React.PropTypes.number.isRequired,
sameUser: React.PropTypes.bool
};