// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import * as Utils from '../utils/utils.jsx'; export default function UserListRow({user, actions}) { const details = []; const fullName = Utils.getFullName(user); if (fullName) { details.push( {fullName} ); } if (user.nickname) { const separator = fullName ? ' - ' : ''; details.push( {separator + user.nickname} ); } const buttons = actions.map((Action, index) => { return ( ); }); return (
{user.username}
{details}
{buttons}
); } UserListRow.defaultProps = { actions: [] }; UserListRow.propTypes = { user: React.PropTypes.object.isRequired, actions: React.PropTypes.arrayOf(React.PropTypes.func) };