<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import Draggable from 'react-draggable';
import Box from '../box/box.jsx';
import styles from './monitor.css';

const categories = {
    data: '#FF8C1A',
    sensing: '#5CB1D6',
    sound: '#CF63CF',
    looks: '#9966FF',
    motion: '#4C97FF'
};

const MonitorComponent = props => (
    <Draggable
        bounds="parent"
        defaultClassNameDragging={styles.dragging}
        onStop={props.onDragEnd}
    >
        <Box
            className={styles.monitor}
            componentRef={props.componentRef}
        >
            <Box className={styles.label}>
                {props.label}
            </Box>
            <Box
                className={styles.value}
                style={{background: categories[props.category]}}
            >
                {props.value}
            </Box>
        </Box>
    </Draggable>
);

MonitorComponent.categories = categories;

MonitorComponent.propTypes = {
    category: PropTypes.oneOf(Object.keys(categories)),
    componentRef: PropTypes.func.isRequired,
    label: PropTypes.string.isRequired,
    onDragEnd: PropTypes.func.isRequired,
    value: PropTypes.string.isRequired
};

MonitorComponent.defaultProps = {
    category: 'data'
};

export default MonitorComponent;<commit_msg>Fixing monitor prop type warning for scalar variable monitors.<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import Draggable from 'react-draggable';
import Box from '../box/box.jsx';
import styles from './monitor.css';

const categories = {
    data: '#FF8C1A',
    sensing: '#5CB1D6',
    sound: '#CF63CF',
    looks: '#9966FF',
    motion: '#4C97FF'
};

const MonitorComponent = props => (
    <Draggable
        bounds="parent"
        defaultClassNameDragging={styles.dragging}
        onStop={props.onDragEnd}
    >
        <Box
            className={styles.monitor}
            componentRef={props.componentRef}
        >
            <Box className={styles.label}>
                {props.label}
            </Box>
            <Box
                className={styles.value}
                style={{background: categories[props.category]}}
            >
                {props.value}
            </Box>
        </Box>
    </Draggable>
);

MonitorComponent.categories = categories;

MonitorComponent.propTypes = {
    category: PropTypes.oneOf(Object.keys(categories)),
    componentRef: PropTypes.func.isRequired,
    label: PropTypes.string.isRequired,
    onDragEnd: PropTypes.func.isRequired,
    value: PropTypes.oneOfType([
        PropTypes.string,
        PropTypes.number])
};

MonitorComponent.defaultProps = {
    category: 'data'
};

export default MonitorComponent;
{'fraction_non_alphanumeric': 0.12280058651026393, 'fraction_numerical': 0.010263929618768328, 'mean_word_length': 2.432704402515723, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '3292067', 'n_tokens_mistral': 779, 'n_tokens_neox': 778, 'n_words': 155}