import React from 'react';
import CustomerProfile from './customer-profile.jsx';

const propTypes = {
    customerApi: React.PropTypes.object,
    languageApi: React.PropTypes.object
};

export default class CustomerProfileContainer extends React.Component {

    static get defaultProps(){
        return {
            customerApi: {},
            languageApi: {}
        };
    }

    render() {
        var isAuthenticated = this.props.customerApi.state.isAuthenticated;
        var language = this.props.languageApi.state.cutomerProfile;
        var customerFormLanguage = this.props.languageApi.state.customerForm;
        return isAuthenticated ? (
            <CustomerProfile
                formData={this.props.customerApi.state}
                language={language}
                customerFormLanguage={customerFormLanguage}
                logout={this.props.customerApi.logout}
                update={this.props.customerApi.update} />
        ) : null;
    }
}

CustomerProfileContainer.propTypes = propTypes;