'use strict';
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import React from 'react';
import PropTypes from 'prop-types';
import { translate } from '../../utils';
import { deprecation } from '../utils/functions';
// @deprecated. use DangerousHTML instead
var Translate = /** @class */ (function (_super) {
    __extends(Translate, _super);
    function Translate() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Translate.prototype.render = function () {
        var _a = this.props, children = _a.children, className = _a.className, testAutomationId = _a.testAutomationId, dataTestAutomationId = _a["data-test-automation-id"];
        //FIXME .toString() of children?
        return (React.createElement("span", { className: className, "data-test-automation-id": testAutomationId || dataTestAutomationId, dangerouslySetInnerHTML: { __html: translate(children, this.props) } }));
    };
    Translate.propTypes = {
        children: PropTypes.node.isRequired,
        className: PropTypes.string,
        testAutomationId: PropTypes.string
    };
    Translate.defaultProps = {
        className: null,
        testAutomationId: null
    };
    return Translate;
}(React.Component));
var DeprecatedTranslate = deprecation(Translate, 'Use `DangerousHTML` component for inserting html or function `translate` for templates/pluralization.');
export { DeprecatedTranslate as Translate };
//# sourceMappingURL=Translate.js.map