UNPKG

@keycloakify/keycloak-admin-ui

Version:
15 lines 978 B
import { jsx as _jsx } from "react/jsx-runtime"; import { FormGroup, TextArea } from "@patternfly/react-core"; import { useId } from "react"; import { useTranslation } from "react-i18next"; import { HelpItem } from "../../ui-shared"; const CertificateDisplay = ({ id, keyInfo }) => { const { t } = useTranslation(); return (_jsx(TextArea, { readOnly: true, rows: 5, id: id, "data-testid": "certificate", value: keyInfo === null || keyInfo === void 0 ? void 0 : keyInfo.certificate, "aria-label": t("certificate") })); }; export const Certificate = ({ keyInfo, plain = false }) => { const { t } = useTranslation(); const id = useId(); return plain ? (_jsx(CertificateDisplay, { id: id, keyInfo: keyInfo })) : (_jsx(FormGroup, { label: t("certificate"), fieldId: id, labelIcon: _jsx(HelpItem, { helpText: t("certificateHelp"), fieldLabelId: id }), children: _jsx(CertificateDisplay, { id: id, keyInfo: keyInfo }) })); }; //# sourceMappingURL=Certificate.js.map