<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import TextInput from '../common/TextInput';
import SelectInput from '../common/SelectInput';
import NumberInput from '../common/NumberInput';

const CourseForm = ({course, allDepartments, onChange, onSave, saving, errors}) => {
    return (
        <form>
            <h1>Manage Course</h1>
            <TextInput 
                name="title"
                label="Title"
                value={course.title}
                onChange={onChange}
            />
            <SelectInput 
                name="departmentID"
                label="Department"
                value={Number(course.departmentID)}
                defaultOption="Select Department"
                options={allDepartments}
                onChange={onChange}
            />
            <NumberInput 
                name="credits"
                label="Credits"
                value={Number(course.credits)}
                onChange={onChange}
            />
            <input 
                type="submit"
                value={saving ? 'Saving...' : 'Save'}
                className="btn btn-primary"
                onClick={onSave}
            /><commit_msg>disable submit button on click<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import TextInput from '../common/TextInput';
import SelectInput from '../common/SelectInput';
import NumberInput from '../common/NumberInput';

const CourseForm = ({course, allDepartments, onChange, onSave, saving, errors}) => {
    return (
        <form>
            <h1>Manage Course</h1>
            <TextInput 
                name="title"
                label="Title"
                value={course.title}
                onChange={onChange}
            />
            <SelectInput 
                name="departmentID"
                label="Department"
                value={Number(course.departmentID)}
                defaultOption="Select Department"
                options={allDepartments}
                onChange={onChange}
            />
            <NumberInput 
                name="credits"
                label="Credits"
                value={Number(course.credits)}
                onChange={onChange}
            />
            <input 
                type="submit"
                disabled={saving}
                value={saving ? 'Saving...' : 'Save'}
                className="btn btn-primary"
                onClick={onSave}
            />
{'fraction_non_alphanumeric': 0.10906911705952857, 'fraction_numerical': 0.0015980823012385138, 'mean_word_length': 1.426356589147287, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '6542948', 'n_tokens_mistral': 623, 'n_tokens_neox': 576, 'n_words': 121}