// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import $ from 'jquery';
import UserProfile from './user_profile.jsx';
import UserStore from 'stores/user_store.jsx';
import * as GlobalActions from 'action_creators/global_actions.jsx';
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
import * as TextFormatting from 'utils/text_formatting.jsx';
import * as Utils from 'utils/utils.jsx';
import Constants from 'utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
import {FormattedMessage, FormattedDate} from 'react-intl';
import React from 'react';
import {browserHistory} from 'react-router';
export default class SearchResultsItem extends React.Component {
constructor(props) {
super(props);
this.handleFocusRHSClick = this.handleFocusRHSClick.bind(this);
}
hideSidebar() {
$('.inner-wrap, .sidebar--right').removeClass('move--left');
}
handleFocusRHSClick(e) {
e.preventDefault();
GlobalActions.emitPostFocusRightHandSideFromSearch(this.props.post, this.props.isMentionSearch);
}
render() {
let channelName = null;
const channel = this.props.channel;
const timestamp = UserStore.getCurrentUser().update_at;
const user = this.props.user || {};
const post = this.props.post;
if (channel) {
channelName = channel.display_name;
if (channel.type === 'D') {
channelName = (