<commit_before>// @flow
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import jwtDecode from 'jwt-decode';

import Browse from '../components/Browse/Browse';
import BrowseHeader from '../components/Browse/BrowseHeader';
import Empty from '../components/Empty';

import { fetchGamesIfNeeded } from '../actions/game';

class BrowsePage extends Component {
  constructor(props) {
    super(props);
  }

  componentDidMount() {
    const { dispatch } = this.props
    dispatch(fetchGamesIfNeeded())
  }

  render() {
    const { games, isFetching } = this.props;

    // Get current user by decoding jwt token
    let token = localStorage.getItem('id_token');
    let currentUser = jwtDecode(token);
    const { isDeveloper } = currentUser;

    // Create props for empty component
    const emptyTitle = "Welcome to Alpha Stage!"
    const emptyDesc = (
      <p><commit_msg>Add comments to BrowsePage<commit_after>// @flow
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import jwtDecode from 'jwt-decode';

import Browse from '../components/Browse/Browse';
import BrowseHeader from '../components/Browse/BrowseHeader';
import Empty from '../components/Empty';

import { fetchGamesIfNeeded } from '../actions/game';

/**
 * BrowsePage container
 * Displays all games on the Library and should filter them but right now
 * it only shows all the games.
 */
class BrowsePage extends Component {
  constructor(props) {
    super(props);
  }

  componentDidMount() {
    const { dispatch } = this.props
    dispatch(fetchGamesIfNeeded())
  }

  render() {
    const { games, isFetching } = this.props;

    // Get current user by decoding jwt token
    let token = localStorage.getItem('id_token');
    let currentUser = jwtDecode(token);
    const { isDeveloper } = currentUser;

    // Create props for empty component
    const emptyTitle = "Welcome to Alpha Stage!"
    const emptyDesc = (
      <p>
{'fraction_non_alphanumeric': 0.11801845556095192, 'fraction_numerical': 0.0, 'mean_word_length': 3.5474613686534218, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6931709', 'n_tokens_mistral': 611, 'n_tokens_neox': 597, 'n_words': 187}