import React, {Component} from 'react';

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

        return (
            <span className="items-cart-count">
                { cartCount === 0
                    ? <span>Cart is empty</span>
                    : cartCount === 1
                        ? <span>1 item in cart</span>
                        : <span>{cartCount} items in cart</span>
                }
            </span>
        );
    }
}

export default CartIcon;
