const React = require('react');

module.exports = React.createClass({
    shouldComponentUpdate: function (nextProps) {
        return this.props.weight !== nextProps.weight;
    },

    render: function () {
        const wrapperProps = {
            onMouseDown: this.props.onMouseDown,
            onMouseUp: this.props.onMouseUp,
            style: {
                cursor: 'pointer',
                display: 'table',
                fontSize: 25,
                left: this.props.left,
                position: 'relative',
                top: this.props.top,
                WebkitUserSelect: 'none'
            }
        };

        return (
            <div {...wrapperProps}>
                {this.props.weight}
            </div>
        );
    }
});
