<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import { InputModal } from 'react-components';

const AskPasswordModal = ({ onClose, onSubmit }) => {
    return (
        <InputModal
            label={c('Label').t`Password`}
            title={c('Title').t`Sign in again to continue`}
            show={true}
            cancel={c('Label').t`Cancel`}
            confirm={c('Label').t`Submit`}
            placeholder={c('Placeholder').t`Password`}
            onSubmit={onSubmit}
            onClose={onClose}
        />
    );
};

AskPasswordModal.propTypes = {
    onClose: PropTypes.func.isRequired,
    onSubmit: PropTypes.func.isRequired
};
export default AskPasswordModal;<commit_msg>Hotfix - Should not be able to see password value<commit_after>import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import { Modal, ContentModal, Row, Label, Password, FooterModal, ResetButton, PrimaryButton } from 'react-components';
import { generateUID } from '../../helpers/component';

const AskPasswordModal = ({ onClose, onSubmit }) => {
    const [input, set] = useState('');
    const id = generateUID('password-modal');
    const handleChange = ({ target }) => set(target.value);
    const handleSubmit = () => onSubmit(input);
    return (
        <Modal show={true} onClose={onClose} title={c('Title').t`Sign in again to continue`} type="small">
            <ContentModal onSubmit={handleSubmit} onReset={onClose}>
                <Row>
                    <Label htmlFor={id}>{c('Label').t`Password`}</Label>
                    <Password id={id} value={input} onChange={handleChange} autoFocus={true} required />
                </Row>
                <FooterModal>
                    <ResetButton>{c('Label').t`Cancel`}</ResetButton>
                    <PrimaryButton type="submit">{c('Label').t`Submit`}</PrimaryButton>
                </FooterModal>
            </ContentModal>
        </Modal>
    );
};

AskPasswordModal.propTypes = {
    onClose: PropTypes.func.isRequired,
    onSubmit: PropTypes.func.isRequired
};
export default AskPasswordModal;
{'fraction_non_alphanumeric': 0.14937759336099585, 'fraction_numerical': 0.0, 'mean_word_length': 2.813708260105448, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '529641', 'n_tokens_mistral': 604, 'n_tokens_neox': 602, 'n_words': 133}