UNPKG

@keycloakify/keycloak-admin-ui

Version:
13 lines 866 B
import { jsx as _jsx } from "react/jsx-runtime"; import { useErrorBoundary, } from "../../ui-shared"; import { Alert, AlertActionCloseButton, AlertActionLink, AlertVariant, PageSection, } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; export const ErrorRenderer = ({ error }) => { const { t } = useTranslation(); const { showBoundary } = useErrorBoundary(); const reset = () => { window.location.href = window.location.origin + window.location.pathname; }; return (_jsx(PageSection, { children: _jsx(Alert, { isInline: true, variant: AlertVariant.danger, title: error.message, actionClose: _jsx(AlertActionCloseButton, { title: error.message, onClose: reset }), actionLinks: _jsx(AlertActionLink, { onClick: () => showBoundary(), children: t("retry") }) }) })); }; //# sourceMappingURL=ErrorRenderer.js.map