import React, { Component } from 'react';

require('./user-info.scss')


class UserInfo extends Component {


	render() {
		let { user, name } = this.props;
		if (!user) {
			user = ( window.cfg && window.cfg.principal ) || {};
		}

		let img = user.avatar || require("./user-placeholder.png");

		return (
            <div className="user-placeholder">
                <img src={ img } />
                <br/>
                <span className="user-name">{ user && (user.firstName + " " + user.lastName) }</span>
            </div>
		);

	}

}


export default UserInfo;
