import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React from 'react';
import ReactCSSTransitionReplace from 'react-css-transition-replace';
import { useExamTranslation } from '../../../i18n';
const RenderIfNoError = ({ error, children }) => {
    const { t } = useExamTranslation();
    return (
    // @types/react 18 removed children from implicit props. This component has not explicitly added them yet
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    React.createElement(ReactCSSTransitionReplace, { transitionName: "e-crossfade", transitionEnterTimeout: 500, transitionLeaveTimeout: 500 }, error != null ? (React.createElement("div", { className: "e-color-error", role: "alert" },
        React.createElement(FontAwesomeIcon, { icon: faExclamationTriangle, className: "e-mrg-r-1" }),
        t(`audio-errors.${error}`))) : (React.createElement("div", { key: "no-error" }, children))));
};
export default RenderIfNoError;
//# sourceMappingURL=RenderIfNoError.js.map