import React, {Component} from 'react';
import {cartTexts} from '../../../constants/cartConstants';

class CartIcon extends Component {
    render() {
        let {cartCount} = this.props;
        cartCount = parseInt(cartCount, 10);

        return (
            <span id="cart-count" className="items-cart-count">
                { cartCount === 0
                    ? <span>{cartTexts.labels.EMPTY_CART_ICON}</span>
                    : cartCount === 1
                        ? <span>1 item in cart</span>
                        : <span>{cartCount} {cartTexts.labels.ITEMS_IN_CART_ICON}</span>
                }

            </span>
        );
    }
}

export default CartIcon;
