"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useValidClassnames = void 0;
var _react = require("react");
var useValidClassnames = (valid, showValidity, customCheck) => {
  var [cname, setCname] = (0, _react.useState)('');
  (0, _react.useEffect)(() => {
    var nCname = '';
    if (showValidity == 1 || showValidity == 4) {
      var custom = true;
      if (customCheck != undefined) {
        custom = customCheck();
      }
      if (!custom || !valid) {
        nCname = 'is-invalid';
      } else {
        nCname = 'is-valid';
      }
    }
    setCname(nCname);
  }, [valid, showValidity, customCheck]);
  return [cname];
};
exports.useValidClassnames = useValidClassnames;