// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import UserStore from '../stores/user_store.jsx';
import UserProfile from './user_profile.jsx';
import * as EventHelpers from '../dispatcher/event_helpers.jsx';
import * as utils from '../utils/utils.jsx';
import * as TextFormatting from '../utils/text_formatting.jsx';
import Constants from '../utils/constants.jsx';
import {FormattedMessage, FormattedDate} from 'mm-intl';
export default class SearchResultsItem extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
this.handleFocusRHSClick = this.handleFocusRHSClick.bind(this);
}
handleClick(e) {
e.preventDefault();
EventHelpers.emitPostFocusEvent(this.props.post.id);
if ($(window).width() < 768) {
$('.sidebar--right').removeClass('move--left');
$('.inner__wrap').removeClass('move--left');
}
}
handleFocusRHSClick(e) {
e.preventDefault();
EventHelpers.emitPostFocusRightHandSideFromSearch(this.props.post, this.props.isMentionSearch);
}
render() {
var channelName = null;
const channel = this.props.channel;
var timestamp = UserStore.getCurrentUser().update_at;
if (channel) {
channelName = channel.display_name;
if (channel.type === 'D') {
channelName = (