<commit_before>import React, {Component} from 'react';
import PropTypes from 'prop-types';
import * as R from 'ramda';
import SheetClip from 'sheetclip';
import Row from './Row.js';
import Header from './Header.js';
import {colIsEditable} from './derivedState';
import {
    KEY_CODES,
    isCtrlMetaKey,
    isCtrlDown,
    isMetaKey,
    isNavKey,
} from '../utils/unicode';
import {selectionCycle} from '../utils/navigation';
import computedStyles from './computedStyles';

import 'react-select/dist/react-select.css';
import './Table.css';
import './Dropdown.css';

export default class Table extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }

    render() {
        if (!this.props.setProps) {
            const newProps = R.mergeAll([
                this.props,
                this.state,
                {
                    setProps: newProps => this.setState(newProps),
                    this: 'that'
                }
            ]);
            console.warn('newProps', newProps);
            return <ControlledTable {...newProps}/>
        } else {
            return <ControlledTable {...R.merge(
                this.props,
                {
                    setProps: newProps => {
                        if (R.has('dataframe', newProps)) {
                            newProps.dataframe_timestamp = Date.now()
                        }
                        this.props.setProps(newProps);
                    }<commit_msg>:hocho: comments<commit_after>import React, {Component} from 'react';
import PropTypes from 'prop-types';
import * as R from 'ramda';
import SheetClip from 'sheetclip';
import Row from './Row.js';
import Header from './Header.js';
import {colIsEditable} from './derivedState';
import {
    KEY_CODES,
    isCtrlMetaKey,
    isCtrlDown,
    isMetaKey,
    isNavKey,
} from '../utils/unicode';
import {selectionCycle} from '../utils/navigation';
import computedStyles from './computedStyles';

import 'react-select/dist/react-select.css';
import './Table.css';
import './Dropdown.css';

export default class Table extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }

    render() {
        if (!this.props.setProps) {
            const newProps = R.mergeAll([
                this.props,
                this.state,
                {
                    setProps: newProps => this.setState(newProps),
                }
            ]);
            return <ControlledTable {...newProps}/>
        } else {
            return <ControlledTable {...R.merge(
                this.props,
                {
                    setProps: newProps => {
                        if (R.has('dataframe', newProps)) {
                            newProps.dataframe_timestamp = Date.now()
                        }
                        this.props.setProps(newProps);
                    }
{'fraction_non_alphanumeric': 0.12345679012345678, 'fraction_numerical': 0.0, 'mean_word_length': 1.6398190045248868, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4093098', 'n_tokens_mistral': 790, 'n_tokens_neox': 765, 'n_words': 181}