import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["error", "inverse", "help", "success", "warning"];
import React from 'react';
import ErrorText from './ErrorText';
import HelpText from './HelpText';
import SuccessText from './SuccessText';
import WarningText from './WarningText';

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

  if (error && typeof error !== 'boolean') {
    return /*#__PURE__*/React.createElement(ErrorText, _extends({
      inverse: inverse
    }, others), error);
  }

  if (warning && typeof warning !== 'boolean') {
    return /*#__PURE__*/React.createElement(WarningText, _extends({
      inverse: inverse
    }, others), warning);
  }

  if (success && typeof success !== 'boolean') {
    return /*#__PURE__*/React.createElement(SuccessText, _extends({
      inverse: inverse
    }, others), success);
  }

  if (help) {
    return /*#__PURE__*/React.createElement(HelpText, _extends({
      inverse: inverse
    }, others), help);
  }

  return null;
};

export default ValidationText;