"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _inputPreview = _interopRequireDefault(require("./input-preview.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const InputPreview = (props, context) => {
  const {
    title,
    text,
    placeholder,
    onChange,
    disabled,
    preview,
    className
  } = props;
  return !preview ? /*#__PURE__*/_react.default.createElement("textarea", {
    "data-testid": "input-preview-textarea",
    className: className,
    name: title,
    value: text,
    placeholder: placeholder,
    onChange: onChange,
    disabled: disabled
  }) : /*#__PURE__*/_react.default.createElement("div", {
    "data-testid": "input-preview",
    className: (0, _classnames.default)(_inputPreview.default.preview, className)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: text
    }
  });
};
InputPreview.propTypes = process.env.NODE_ENV !== "production" ? {
  text: _propTypes.default.string.isRequired,
  title: _propTypes.default.string,
  placeholder: _propTypes.default.string,
  disabled: _propTypes.default.bool,
  preview: _propTypes.default.bool.isRequired,
  onChange: _propTypes.default.func,
  className: _propTypes.default.string
} : {};
var _default = exports.default = InputPreview;
//# sourceMappingURL=input-preview.js.map