<commit_before>import React, { useState } from 'react';
import TextField from '@material-ui/core/TextField';

import PropTypes from 'prop-types';
import PromptDialog from '..';

function PromptNumberDialog({ onYesClicked, ...rest }) {
  const [value, setValue] = useState(1);

  const confirm = () => {
    onYesClicked(value);
  };

  const changeValue = ({ target }) => {
    setValue(target.value);
  };

  return (
    <div>
      <PromptDialog onYesClicked={confirm} {...rest}>
        <TextField
          autoFocus
          onChange={changeValue}
          margin="dense"
          id="prompt-dialog-count"
          type="number"
          defaultValue={1}
          inputProps={{ min: 1 }}
          fullWidth
        />
      </PromptDialog>
    </div>
  );
}

PromptNumberDialog.defaultProps = {
  confirmLabel: 'OK',
  cancelLabel: 'Cancel',
};

PromptNumberDialog.propTypes = {
  onYesClicked: PropTypes.func.isRequired,
  confirmLabel: PropTypes.string,
  cancelLabel: PropTypes.string,
};<commit_msg>fix(BAM) Duplication prompt dialog updated with value (#137)<commit_after>import React, { useState } from 'react';
import TextField from '@material-ui/core/TextField';

import PropTypes from 'prop-types';
import PromptDialog from '..';

function PromptNumberDialog({ onYesClicked, ...rest }) {
  const [value, setValue] = useState(1);

  const confirm = () => {
    onYesClicked(value);
  };

  const changeValue = ({ target }) => {
    setValue(target.value);
  };

  return (
    <div>
      <PromptDialog onYesClicked={confirm} {...rest}>
        <TextField
          autoFocus
          onChange={changeValue}
          margin="dense"
          id="prompt-dialog-count"
          type="number"
          value={value}
          defaultValue={1}
          inputProps={{ min: 1 }}
          fullWidth
        />
      </PromptDialog>
    </div>
  );
}

PromptNumberDialog.defaultProps = {
  confirmLabel: 'OK',
  cancelLabel: 'Cancel',
};

PromptNumberDialog.propTypes = {
  onYesClicked: PropTypes.func.isRequired,
  confirmLabel: PropTypes.string,
  cancelLabel: PropTypes.string,
};
{'fraction_non_alphanumeric': 0.1388492629576795, 'fraction_numerical': 0.0042796005706134095, 'mean_word_length': 2.8047016274864376, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '1797012', 'n_tokens_mistral': 640, 'n_tokens_neox': 639, 'n_words': 130}