UNPKG

@keycloakify/keycloak-admin-ui

Version:
13 lines 1.22 kB
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { Button, Modal, ModalVariant, Text, TextArea, TextContent, TextVariants, } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import { prettyPrintJSON } from "../../util"; import useToggle from "../../utils/useToggle"; export const AuthorizationDataModal = ({ data, }) => { const { t } = useTranslation(); const [show, toggle] = useToggle(); return (_jsxs(_Fragment, { children: [_jsx(Button, { "data-testid": "authorization-revert", onClick: toggle, variant: "secondary", children: t("showAuthData") }), _jsx(Modal, { variant: ModalVariant.medium, isOpen: show, "aria-label": t("authData"), header: _jsxs(TextContent, { children: [_jsx(Text, { component: TextVariants.h1, children: t("authData") }), _jsx(Text, { children: t("authDataDescription") })] }), onClose: toggle, actions: [ _jsx(Button, { "data-testid": "cancel", id: "modal-cancel", onClick: toggle, children: t("cancel") }, "cancel"), ], children: _jsx(TextArea, { readOnly: true, rows: 20, value: prettyPrintJSON(data) }) })] })); }; //# sourceMappingURL=AuthorizationDataModal.js.map