"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const formik_1 = require("formik");
const React = tslib_1.__importStar(require("react"));
const TextAreaField_1 = tslib_1.__importDefault(require("./TextAreaField"));
const utils_1 = require("./utils");
const AdditionalNTPSourcesField = ({ name, label, isRequired, isDisabled, helperText, }) => {
    const [field, , { setValue, setTouched }] = (0, formik_1.useField)(name);
    const formatAdditionalNtpSources = () => {
        if (field.value && field.value !== '') {
            setValue((0, utils_1.trimCommaSeparatedList)(field.value));
            setTouched(true);
        }
    };
    return (React.createElement(TextAreaField_1.default, { name: name, label: label, helperText: helperText, onBlur: formatAdditionalNtpSources, spellCheck: false, isRequired: isRequired, isDisabled: isDisabled }));
};
exports.default = AdditionalNTPSourcesField;
//# sourceMappingURL=AdditionalNTPSourcesField.js.map