var Inventory = React.createClass({
    propTypes: {
      cards: React.PropTypes.array
    },

    getInitialState: function() {
      return {
        cards: this.props.cards
      };
    },

  render: function() {
    if (this.props.cards) {
      return (
        <div>
          Inventory:
          <ul>
            {this.props.cards.map(function(card) {
              return <li key={card.id}>
                <label>
                  <input
                    form={"player_controls_" + card.player_id}
                    type="checkbox"
                    name="player_card_ids[]"
                    value={card.id} />
                  {card.rank} {card.suit}
                </label>
              </li>;
            })}
          </ul>
        </div>
      );
    }
    else {
      return (<div></div>);
    }
  }
});
