<commit_before>React = require('react')
import fetch from 'isomorphic-fetch'

import { Grid } from 'react-bootstrap'
import callApi from '../lib/callApi'

import Tree from '../components/Tree'
import Root from '../components/Root'

class RootPage extends React.Component
    constructor: (props) ->
        super(props)
        @state = props.data || window.__INITIAL_STATE__ || {}

    render:  () ->
        return
            <Grid fluid>
                <Root tree={@state.tree}/>
            </Grid>

    componentDidMount: ->
        @reload()

    reload: ->
        data = await MaterialPage.loadData(@props.match)
        @setState(data)

    @loadData: (match) ->
        #tree = await callApi 'material/tree'
        tree = undefined
        return
            tree: tree

export default RootPage<commit_msg>Restore root page tree<commit_after>React = require('react')
import fetch from 'isomorphic-fetch'

import { Grid } from 'react-bootstrap'
import callApi from '../lib/callApi'

import Tree from '../components/Tree'
import Root from '../components/Root'

class RootPage extends React.Component
    constructor: (props) ->
        super(props)
        @state = props.data || window.__INITIAL_STATE__ || {}

    render:  () ->
        return
            <Grid fluid>
                <Root tree={@state.tree}/>
            </Grid>

    componentDidMount: ->
        @reload()

    reload: ->
        data = await MaterialPage.loadData(@props.match)
        @setState(data)

    @loadData: (match) ->
        tree = await callApi 'material/tree'
        return
            tree: tree

export default RootPage
{'fraction_non_alphanumeric': 0.12338062924120913, 'fraction_numerical': 0.0, 'mean_word_length': 2.211881188118812, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, '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': '332477', 'n_tokens_mistral': 453, 'n_tokens_neox': 444, 'n_words': 120}