"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _ErrorText = _interopRequireDefault(require("./ErrorText"));

var _HelpText = _interopRequireDefault(require("./HelpText"));

var _SuccessText = _interopRequireDefault(require("./SuccessText"));

var _WarningText = _interopRequireDefault(require("./WarningText"));

var _excluded = ["error", "inverse", "help", "success", "warning"];

var ValidationText = function ValidationText(_ref) {
  var error = _ref.error,
      inverse = _ref.inverse,
      help = _ref.help,
      success = _ref.success,
      warning = _ref.warning,
      others = (0, _objectWithoutProperties2.default)(_ref, _excluded);

  if (error && typeof error !== 'boolean') {
    return /*#__PURE__*/_react.default.createElement(_ErrorText.default, (0, _extends2.default)({
      inverse: inverse
    }, others), error);
  }

  if (warning && typeof warning !== 'boolean') {
    return /*#__PURE__*/_react.default.createElement(_WarningText.default, (0, _extends2.default)({
      inverse: inverse
    }, others), warning);
  }

  if (success && typeof success !== 'boolean') {
    return /*#__PURE__*/_react.default.createElement(_SuccessText.default, (0, _extends2.default)({
      inverse: inverse
    }, others), success);
  }

  if (help) {
    return /*#__PURE__*/_react.default.createElement(_HelpText.default, (0, _extends2.default)({
      inverse: inverse
    }, others), help);
  }

  return null;
};

var _default = ValidationText;
exports.default = _default;