// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. var UserStore = require('../stores/user_store.jsx'); const Utils = require('../utils/utils.jsx'); export default class Mention extends React.Component { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); this.state = null; } handleClick() { this.props.handleClick(this.props.username); } render() { var icon; var timestamp = UserStore.getCurrentUser().update_at; if (this.props.id === 'allmention' || this.props.id === 'channelmention') { icon = ; } else if (this.props.id == null) { icon = ; } else { icon = ( ); } return (
{icon}
@{this.props.username}{this.props.secondary_text}
); } } Mention.defaultProps = { username: '', id: '', isFocused: '', secondary_text: '' }; Mention.propTypes = { handleClick: React.PropTypes.func.isRequired, handleMouseEnter: React.PropTypes.func.isRequired, username: React.PropTypes.string, id: React.PropTypes.string, isFocused: React.PropTypes.string, secondary_text: React.PropTypes.string };