import React from 'react';

const propTypes = {
    language: React.PropTypes.object.isRequired,
    totalPrice: React.PropTypes.string,
    totalPriceWithoutTax: React.PropTypes.string
};

export default class CartTotal extends React.Component {

    static get defaultProps(){
        return {
            language: {},
            totalPrice: null,
            totalPriceWithoutTax: null
        };
    }

    render() {
        const { language, totalPrice, totalPriceWithoutTax } = this.props;
        return (
            <section className="cart-total">
                <span className="cart-total__heading">
                    {language.total} {totalPrice}
                </span>
                <span className="cart-total__text">
                    {totalPriceWithoutTax} {language.exVat}
                </span>
            </section>
        );
    }
}

CartTotal.propTypes = propTypes;