"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const formik_1 = require("formik");
const ui_1 = require("../ui");
const SecurityFields_1 = require("./SecurityFields");
const use_translation_wrapper_1 = require("../../hooks/use-translation-wrapper");
const UploadSSH = ({ isRequired, labelText }) => {
    const [{ name }, , { setValue }] = (0, formik_1.useField)('sshPublicKey');
    const { t } = (0, use_translation_wrapper_1.useTranslation)();
    const defaultLabelText = t('ai:Provide an SSH key to be able to connect to the hosts for debugging purposes during the discovery process');
    return (React.createElement(ui_1.UploadField, { label: React.createElement(React.Fragment, null,
            t('ai:SSH public key'),
            " ",
            React.createElement(ui_1.PopoverIcon, { bodyContent: labelText || defaultLabelText })), name: name, helperText: React.createElement(SecurityFields_1.SshPublicKeyHelperText, null), idPostfix: "discovery", isRequired: isRequired, onBlur: (_event, value) => value && setValue((0, ui_1.trimSshPublicKey)(value)) }));
};
exports.default = UploadSSH;
//# sourceMappingURL=UploadSSH.js.map