<commit_before>import React from 'react';

import { Board } from './Board';
import { useWASMState, STATE_DEFAULT } from './useWASMState';

import './App.css';

export function App() {
  console.group('App')
  const { state, hasLoaded, dispatch } = useWASMState();
  // const dispatch = (e) => console.log('dispatched', e);
  // const state = {...STATE_DEFAULT};
  // const state = {...result.state}<commit_msg>Trying to figure out the double render issue<commit_after>import React, { useState, useEffect } from 'react';

import { waitForWASM } from './waitForWASM';
import { Board } from './Board';
import { useWASMState, STATE_DEFAULT } from './useWASMState';

import './App.css';

export function App() {
  console.group('App');
  const [state, setState] = useState(null);
  // const { state, hasLoaded, dispatch } = useWASMState();
  console.log('state', state);
  // console.log('hasLoaded', hasLoaded);

  const dispatch = e => console.log('dispatch', e);
  // On mount, fetch the WASM
  // useEffect(() => {
  //   console.group('useEffect on mount')
  //   // waitForWASM().then(resp => dispatch({type: 'init', wasm: resp}));
  //   waitForWASM().then(wasm => {
  //     const game = wasm.new_game();
  //     console.log('new game', game);
  //     // setState({
  //     //   wasm,
  //     //   game,
  //     //   stepNumber: game.step_number,
  //     //   board: wasm.get_board(game),
  //     // });
  //   });
  //   console.groupEnd();
  // }, []);


  if (state === null) {
    console.groupEnd();
    return <div className="tic-tac-toe">
      <p>Loading...</p>
    </div>;
  }



  const moves = [
    <h1 key={0}>Moves</h1>
  ];
  const status = 'Buu';

  console.groupEnd();
  return <div className="game">
    <div className="game-board">
      Board
    </div>
    <div className="game-info">
      <div>{status}</div>
      <ol>{moves}</ol>
    </div>
  </div>
}







export function App1() {
  console.group('App')
  const { state, hasLoaded, dispatch } = useWASMState();
  // const dispatch = (e) => console.log('dispatched', e);
  // const state = {...STATE_DEFAULT};
  // const state = {...result.state}
{'fraction_non_alphanumeric': 0.19971870604781997, 'fraction_numerical': 0.001875293014533521, 'mean_word_length': 2.6920415224913494, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1181076', 'n_tokens_mistral': 738, 'n_tokens_neox': 711, 'n_words': 163}