<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import isBlank from 'ringcentral-integration/lib/isBlank';

import Button from '../Button';

import styles from './styles.scss';
import i18n from './i18n';

const CALL_YOU = 0;
const CALL_ME = 1;
const ON_MY_WAY = 2;
const CUSTOM_MESSAGE = 3;

const MINS = 0;
const HOURS = 1;
const DAYS = 2;

const cleanRegex = /[^\d]/g;

function TimeInput(props) {
  return (
    <div className={styles.timeInput}>
      <span className={styles.timeValue}>
        <input
          maxLength={3}
          value={props.timeValue}
          onChange={props.onTimeValueChange}
          ref={props.inputRef}
        />
      </span>
      <span
        onClick={() => props.onSelectTimeUnit(MINS)}
        className={props.timeUnit === MINS ? styles.timeUnitSelected : null}>
        {i18n.getString('min', props.currentLocale)}
      </span>
      <span
        className={props.timeUnit === HOURS ? styles.timeUnitSelected : null}
        onClick={() => props.onSelectTimeUnit(HOURS)}>
        {i18n.getString('hours', props.currentLocale)}
      </span>
      <span
        className={props.timeUnit === DAYS ? styles.timeUnitSelected : null}
        onClick={() => props.onSelectTimeUnit(DAYS)}>
        {i18n.getString('days', props.currentLocale)}
      </span>
    </div>
  );
}

TimeInput.propTypes = {
  currentLocale: PropTypes.string.isRequired,
  timeValue: PropTypes.string,
  timeUnit: PropTypes.number,
  inputRef: PropTypes.func.isRequired,<commit_msg>change maxLength to 2 (#290)<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import isBlank from 'ringcentral-integration/lib/isBlank';

import Button from '../Button';

import styles from './styles.scss';
import i18n from './i18n';

const CALL_YOU = 0;
const CALL_ME = 1;
const ON_MY_WAY = 2;
const CUSTOM_MESSAGE = 3;

const MINS = 0;
const HOURS = 1;
const DAYS = 2;

const cleanRegex = /[^\d]/g;

function TimeInput(props) {
  return (
    <div className={styles.timeInput}>
      <span className={styles.timeValue}>
        <input
          maxLength={2}
          value={props.timeValue}
          onChange={props.onTimeValueChange}
          ref={props.inputRef}
        />
      </span>
      <span
        onClick={() => props.onSelectTimeUnit(MINS)}
        className={props.timeUnit === MINS ? styles.timeUnitSelected : null}>
        {i18n.getString('min', props.currentLocale)}
      </span>
      <span
        className={props.timeUnit === HOURS ? styles.timeUnitSelected : null}
        onClick={() => props.onSelectTimeUnit(HOURS)}>
        {i18n.getString('hours', props.currentLocale)}
      </span>
      <span
        className={props.timeUnit === DAYS ? styles.timeUnitSelected : null}
        onClick={() => props.onSelectTimeUnit(DAYS)}>
        {i18n.getString('days', props.currentLocale)}
      </span>
    </div>
  );
}

TimeInput.propTypes = {
  currentLocale: PropTypes.string.isRequired,
  timeValue: PropTypes.string,
  timeUnit: PropTypes.number,
  inputRef: PropTypes.func.isRequired,
{'fraction_non_alphanumeric': 0.14115058157812008, 'fraction_numerical': 0.012574662055957246, 'mean_word_length': 3.1058064516129034, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 31, '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': '1070562', 'n_tokens_mistral': 1024, 'n_tokens_neox': 996, 'n_words': 215}