// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import * as Utils from '../utils/utils.jsx'; import {FormattedMessage} from 'mm-intl'; var Popover = ReactBootstrap.Popover; var OverlayTrigger = ReactBootstrap.OverlayTrigger; var id = 0; function nextId() { id = id + 1; return id; } export default class UserProfile extends React.Component { constructor(props) { super(props); this.uniqueId = nextId(); } componentDidMount() { if (!this.props.disablePopover) { $('body').tooltip({selector: '[data-toggle=tooltip]', trigger: 'hover click'}); } } render() { var name = Utils.displayUsername(this.props.user.id); if (this.props.overwriteName) { name = this.props.overwriteName; } else if (!name) { name = '...'; } if (this.props.disablePopover) { return