@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
28 lines (27 loc) • 1.46 kB
JavaScript
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the BSD 3-Clause license found in the
* LICENSE file in the root directory of this source tree.
*/
import { h } from "@stencil/core";
import { Download, Typography } from "@peculiar/certificates-viewer";
import { getString } from "../../utils/l10n";
import { FortifyButton } from "../fortify-button";
export const EnrollmentResolved = (props) => {
const { pem, type, name, onClose, } = props;
const handleClickDownload = () => {
if (type === 'pkcs10') {
Download.csr.asPEM(pem, name);
}
else {
Download.cert.asPEM(pem, name);
}
};
return (h("div", { class: "enrollment_form" }, h("header", { class: "enrollment_form_header" }, h(Typography, { variant: "h5", color: "black" }, type === 'pkcs10' ? getString('enrollment.success.csr.title') : getString('enrollment.success.certificate.title'))), h("div", { class: "enrollment_form_content" }, h("textarea", { class: "form_field form_field_result t-b3", readOnly: true }, pem)), h("footer", { class: "enrollment_form_footer container_actions" }, h(FortifyButton, { onClick: onClose }, getString('actions.close')), h(FortifyButton, { variant: "primary", onClick: handleClickDownload }, "Download PEM"))));
};
//# sourceMappingURL=enrollment-resolved.js.map