{"size": 1664, "ext": "js", "max_stars_repo_path": "src/components/Board.js", "max_stars_repo_name": "NickHeiner/camelot-web", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Board.js", "max_issues_repo_name": "NickHeiner/camelot-web", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Board.js", "max_forks_repo_name": "NickHeiner/camelot-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.3962264151, "max_line_length": 76, "alphanum_fraction": 0.4435096154}
import React, {PureComponent} from 'react';
import {Modal} from 'react-bootstrap';
import camelotEngine from 'camelot-engine';
import _ from 'lodash';
import './Board.less';
import BoardSpace from './BoardSpace';

class Board extends PureComponent {
  render() {

    const camelotConstants = camelotEngine().constants(),
      boardPieces = _(camelotConstants.BOARD_HEIGHT)
                .range()
                .map(row => _(camelotConstants.BOARD_WIDTH)
                    .range()
                    .map(col => 
                        <BoardSpace 
                        row={row} 
                        col={col} 
                        key={`${row}-${col}`} 
                        gameId={this.props.gameId}
                        gameState={this.props.gameState} 
                        currentUserPlayer={this.props.currentUserPlayer}
                        isCurrentUserActive={this.props.isCurrentUserActive}
                    />)
                    .value()
                )
                .flatten()
                .value();
        
    return (
      <div className="board-wrapper modal-container">
          <div className="board">
              {this.props.message &&  
                  <Modal
                      show={true}
                      container={this}
                      className="status-modal"
                      aria-label="Game status message">
                      <Modal.Body>
                          {this.props.message}
                      </Modal.Body>
                  </Modal>
              }
              {boardPieces}
          </div>
      </div>
    );
  }
}

export default Board;
