<commit_before>import React, { Component } from 'react';
import Input from '../Input'

export default class ChangePasswordForm extends Component {

    constructor(props) {
        super(props);

    }

    render() {
        const inputs = this.props.formData.inputs;

        return (
            <div>
                <div className="modal__header">
                    <h2>Change password</h2>
                </div>
                <form onSubmit={this.props.formData.onSubmit}>
                    <div className="modal__body">
                        {
                            inputs.map((input, index) => {
                                return <Input key={index} {...input} />
                            })
                        }
                    </div>
                    <div className="modal__footer">
                        <button className="btn btn--positive" onClick={this.props.formData.onSubmit}>Update password</button>
                        <button className="btn" onClick={this.props.formData.onCancel}>Cancel</button>
                    </div>
                </form>
            </div>
        )
    }
}
<commit_msg>Add proptypes<commit_after>import React, { Component } from 'react';
import Input from '../Input'
import PropTypes from 'prop-types';

const propTypes = {
    formData: PropTypes.shape({
        inputs: PropTypes.arrayOf(PropTypes.shape({
            id: PropTypes.string.isRequired,
            value: PropTypes.string,
            label: PropTypes.string.isRequired,
            type: PropTypes.string,
            onChange: PropTypes.func,
            error: PropTypes.string
        })),
        onSubmit: PropTypes.func.isRequired,
        onCancel: PropTypes.func.isRequired
    }).isRequired
};

export default class ChangePasswordForm extends Component {

    constructor(props) {
        super(props);

    }

    render() {
        const inputs = this.props.formData.inputs;

        return (
            <div>
                <div className="modal__header">
                    <h2>Change password</h2>
                </div>
                <form onSubmit={this.props.formData.onSubmit}>
                    <div className="modal__body">
                        {
                            inputs.map((input, index) => {
                                return <Input key={index} {...input} />
                            })
                        }
                    </div>
                    <div className="modal__footer">
                        <button className="btn btn--positive" onClick={this.props.formData.onSubmit}>Update password</button>
                        <button className="btn" onClick={this.props.formData.onCancel}>Cancel</button>
                    </div>
                </form>
            </div>
        )
    }
}

ChangePasswordForm.propTypes = propTypes;

{'fraction_non_alphanumeric': 0.11122770199370409, 'fraction_numerical': 0.0013990905911157748, 'mean_word_length': 1.3519736842105263, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, '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': '4889798', 'n_tokens_mistral': 706, 'n_tokens_neox': 680, 'n_words': 134}