// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import Suggestion from './suggestion.jsx'; import Provider from './provider.jsx'; import {autocompleteUsersInTeam} from 'actions/user_actions.jsx'; import AppDispatcher from 'dispatcher/app_dispatcher.jsx'; import {Client4} from 'mattermost-redux/client'; import * as Utils from 'utils/utils.jsx'; import {ActionTypes} from 'utils/constants.jsx'; import React from 'react'; class SearchUserSuggestion extends Suggestion { render() { const {item, isSelection} = this.props; let className = 'search-autocomplete__item'; if (isSelection) { className += ' selected'; } const username = item.username; let description = ''; if ((item.first_name || item.last_name) && item.nickname) { description = `- ${Utils.getFullName(item)} (${item.nickname})`; } else if (item.nickname) { description = `- (${item.nickname})`; } else if (item.first_name || item.last_name) { description = `- ${Utils.getFullName(item)}`; } return (